Comparing version 0.5.7 to 0.5.8
0.5.8 / 2014-03-07 | ||
================== | ||
* Fixed single jobs not being saved properly [closes #38] | ||
0.5.7 / 2014-03-06 | ||
@@ -3,0 +8,0 @@ ================== |
@@ -112,3 +112,4 @@ var Job = require('./job.js'), | ||
var props = job.toJSON(); | ||
var props = job.toJSON(), | ||
newOrUnloaded = typeof props._id == 'undefined'; | ||
@@ -119,10 +120,11 @@ delete props._id; | ||
if(props.type == 'single') { | ||
var preservedProps = {}, | ||
keep = [ 'lastRunAt', 'lastFinishedAt', 'nextRunAt', 'failReason', 'failedAt', 'lockedAt']; | ||
var preservedProps = {}; | ||
keep.forEach(function(prop) { | ||
preservedProps[prop] = props[prop]; | ||
delete props[prop]; | ||
}); | ||
if(newOrUnloaded) { | ||
var 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); | ||
@@ -129,0 +131,0 @@ } else { |
{ | ||
"name": "agenda", | ||
"version": "0.5.7", | ||
"version": "0.5.8", | ||
"description": "Light weight job scheduler for Node.js", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
44673
826