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 = ...@@ -359,13 +359,13 @@ var JIO =
//// browsing current jobs //// browsing current jobs
for (id in priv.jobObject) { for (id in priv.jobObject) {
if (jioGlobalObj.jobManagingMethod.canRemoveFailOrDone(
priv.jobObject[id],job)) {
res.removeArray.push(id);
continue;
}
if (jioGlobalObj.jobManagingMethod.canSelect( if (jioGlobalObj.jobManagingMethod.canSelect(
priv.jobObject[id],job)) { priv.jobObject[id],job)) {
if (jioGlobalObj.jobManagingMethod.canRemoveFailOrDone(
priv.jobObject[id],job)) {
res.removeArray.push(id);
continue;
}
if (jioGlobalObj.jobManagingMethod.canEliminate( if (jioGlobalObj.jobManagingMethod.canEliminate(
priv.jobObject[id],job)) { priv.jobObject[id],job)) {
res.elimArray.push(id); res.elimArray.push(id);
...@@ -543,25 +543,13 @@ var JIO = ...@@ -543,25 +543,13 @@ var JIO =
//// end method analyse //// end method analyse
}; };
that.ended = function (job) { that.ended = function (endedjob) {
// It is a callback function called just before user callback. // It is a callback function called just before user callback.
// It is called to manage jobObject according to the ended job. // It is called to manage jobObject according to the ended job.
switch (job.status) { var job = $.extend({},endedjob); // copy
case 'done': // This job is supposed terminated, we can remove it from queue.
// This job is supposed done, we can remove it from queue. that.removeJob ({'job':job});
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 //// ended job analyse
// if the job method does not exists, return false // if the job method does not exists, return false
......
This diff is collapsed.
...@@ -356,13 +356,13 @@ var JIO = ...@@ -356,13 +356,13 @@ var JIO =
//// browsing current jobs //// browsing current jobs
for (id in priv.jobObject) { for (id in priv.jobObject) {
if (jioGlobalObj.jobManagingMethod.canRemoveFailOrDone(
priv.jobObject[id],job)) {
res.removeArray.push(id);
continue;
}
if (jioGlobalObj.jobManagingMethod.canSelect( if (jioGlobalObj.jobManagingMethod.canSelect(
priv.jobObject[id],job)) { priv.jobObject[id],job)) {
if (jioGlobalObj.jobManagingMethod.canRemoveFailOrDone(
priv.jobObject[id],job)) {
res.removeArray.push(id);
continue;
}
if (jioGlobalObj.jobManagingMethod.canEliminate( if (jioGlobalObj.jobManagingMethod.canEliminate(
priv.jobObject[id],job)) { priv.jobObject[id],job)) {
res.elimArray.push(id); res.elimArray.push(id);
...@@ -540,25 +540,13 @@ var JIO = ...@@ -540,25 +540,13 @@ var JIO =
//// end method analyse //// end method analyse
}; };
that.ended = function (job) { that.ended = function (endedjob) {
// It is a callback function called just before user callback. // It is a callback function called just before user callback.
// It is called to manage jobObject according to the ended job. // It is called to manage jobObject according to the ended job.
switch (job.status) { var job = $.extend({},endedjob); // copy
case 'done': // This job is supposed terminated, we can remove it from queue.
// This job is supposed done, we can remove it from queue. that.removeJob ({'job':job});
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 //// ended job analyse
// if the job method does not exists, return false // 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