Commit a4bba05b authored by Tristan Cavelier's avatar Tristan Cavelier

job queue is not well cleaned -> fixed

parent d0802be2
/*jslint indent: 2, maxlen: 80, sloppy: true, nomen: true, unparam: true */
/*global arrayInsert, indexOf, deepClone, defaults */
/*global arrayInsert, indexOf, deepClone, defaults, IODeferred */
// creates
// - some defaults job rule actions
......@@ -44,8 +44,9 @@ function enableJobChecker(jio, shared, options) {
new_job.modified = new Date();
},
deny: function (original_job, new_job) {
new_job.state = 'running';
new_job.command.reject(
new_job.state = 'fail';
new_job.modified = new Date();
IODeferred.createFromParam(new_job).reject(
'precondition_failed',
'command denied',
'Command rejected by the job checker.'
......
/*jslint indent: 2, maxlen: 80, sloppy: true, nomen: true, unparam: true */
/*global arrayExtend, localStorage, Workspace, uniqueJSONStringify, JobQueue,
constants */
constants, indexOf */
function enableJobQueue(jio, shared, options) {
......@@ -40,11 +40,13 @@ function enableJobQueue(jio, shared, options) {
);
shared.on('job', function (param) {
if (!param.stored) {
shared.job_queue.load();
shared.job_queue.post(param);
shared.job_queue.save();
param.stored = true;
if (indexOf(param.state, ['fail', 'done']) === -1) {
if (!param.stored) {
shared.job_queue.load();
shared.job_queue.post(param);
shared.job_queue.save();
param.stored = true;
}
}
});
......
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