Comparing version 0.5.6 to 0.5.7
0.5.7 / 2014-03-06 | ||
================== | ||
* fix every re-running jobs out of queue at load | ||
0.5.6 / 2014-02-18 | ||
@@ -3,0 +8,0 @@ ================== |
@@ -116,5 +116,14 @@ var Job = require('./job.js'), | ||
if(props.type == 'single') | ||
this._db.findAndModify({name: props.name, type: 'single'}, {}, {$set: props}, {upsert: true, new: true}, processDbResult); | ||
else { | ||
if(props.type == 'single') { | ||
var preservedProps = {}, | ||
keep = [ 'lastRunAt', 'lastFinishedAt', 'nextRunAt', 'failReason', 'failedAt', 'lockedAt']; | ||
keep.forEach(function(prop) { | ||
preservedProps[prop] = props[prop]; | ||
delete props[prop]; | ||
}); | ||
this._db.findAndModify({name: props.name, type: 'single'}, {}, {$set: props, $setOnInsert: preservedProps}, {upsert: true, new: true}, processDbResult); | ||
} else { | ||
if(job.attrs._id) { | ||
@@ -121,0 +130,0 @@ this._db.findAndModify({_id: job.attrs._id}, {}, {$set: props}, {new: true}, processDbResult); |
{ | ||
"name": "agenda", | ||
"version": "0.5.6", | ||
"version": "0.5.7", | ||
"description": "Light weight job scheduler for Node.js", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -22,3 +22,3 @@ # Agenda | ||
You will also need a working [mongo](http://www.mongodb.org/) database to point it to. | ||
You will also need a working [mongo](http://www.mongodb.org/) database (2.4+) to point it to. | ||
@@ -529,3 +529,3 @@ # Example Usage | ||
function addJobWorker() { | ||
webWorkers.push(cluster.fork({job: 1}).id); | ||
jobWorkers.push(cluster.fork({job: 1}).id); | ||
} | ||
@@ -532,0 +532,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
44479
823