Commit a7cb5e61 authored by Tristan Cavelier's avatar Tristan Cavelier Committed by Sebastien Robin

Fix: fail or done jobs are now always deleted.

parent cb89209b
......@@ -359,13 +359,13 @@ var JIO =
//// browsing current jobs
for (id in priv.jobObject) {
if (jioGlobalObj.jobManagingMethod.canSelect(
priv.jobObject[id],job)) {
if (jioGlobalObj.jobManagingMethod.canRemoveFailOrDone(
priv.jobObject[id],job)) {
res.removeArray.push(id);
continue;
}
if (jioGlobalObj.jobManagingMethod.canSelect(
priv.jobObject[id],job)) {
if (jioGlobalObj.jobManagingMethod.canEliminate(
priv.jobObject[id],job)) {
res.elimArray.push(id);
......@@ -543,25 +543,13 @@ var JIO =
//// end method analyse
};
that.ended = function (job) {
that.ended = function (endedjob) {
// It is a callback function called just before user callback.
// It is called to manage jobObject according to the ended job.
switch (job.status) {
case 'done':
// This job is supposed done, we can remove it from queue.
var job = $.extend({},endedjob); // copy
// This job is supposed terminated, we can remove it from queue.
that.removeJob ({'job':job});
break;
case 'fail':
// This job cannot be done.
// save to local storage
that.copyJobQueueToLocalStorage ();
break;
case 'wait':
break;
default:
break;
}
//// ended job analyse
// if the job method does not exists, return false
......
This diff is collapsed.
......@@ -356,13 +356,13 @@ var JIO =
//// browsing current jobs
for (id in priv.jobObject) {
if (jioGlobalObj.jobManagingMethod.canSelect(
priv.jobObject[id],job)) {
if (jioGlobalObj.jobManagingMethod.canRemoveFailOrDone(
priv.jobObject[id],job)) {
res.removeArray.push(id);
continue;
}
if (jioGlobalObj.jobManagingMethod.canSelect(
priv.jobObject[id],job)) {
if (jioGlobalObj.jobManagingMethod.canEliminate(
priv.jobObject[id],job)) {
res.elimArray.push(id);
......@@ -540,25 +540,13 @@ var JIO =
//// end method analyse
};
that.ended = function (job) {
that.ended = function (endedjob) {
// It is a callback function called just before user callback.
// It is called to manage jobObject according to the ended job.
switch (job.status) {
case 'done':
// This job is supposed done, we can remove it from queue.
var job = $.extend({},endedjob); // copy
// This job is supposed terminated, we can remove it from queue.
that.removeJob ({'job':job});
break;
case 'fail':
// This job cannot be done.
// save to local storage
that.copyJobQueueToLocalStorage ();
break;
case 'wait':
break;
default:
break;
}
//// ended job analyse
// if the job method does not exists, return false
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment