Skip to content

Commit

Permalink
code cleanup, fix leaking ignoreErrors
Browse files Browse the repository at this point in the history
  • Loading branch information
rschmukler committed Feb 3, 2015
1 parent 74a2ede commit b189577
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/agenda.js
Expand Up @@ -42,7 +42,7 @@ Agenda.prototype.database = function(url, collection, options) {

this._db = mongo.db(url, options).collection(collection);

ignoreErrors = function() {};
var ignoreErrors = function() {};
this._db.ensureIndex("nextRunAt", ignoreErrors)
.ensureIndex("lockedAt", ignoreErrors)
.ensureIndex("name", ignoreErrors)
Expand Down Expand Up @@ -177,10 +177,10 @@ Agenda.prototype.saveJob = function(job, cb) {

var props = job.toJSON();
var id = job.attrs._id;
var unique = job.attrs.unique;
var unique = job.attrs.unique;

delete props._id;
delete props.unique;
delete props.unique;

props.lastModifiedBy = this._name;

Expand All @@ -205,7 +205,7 @@ Agenda.prototype.saveJob = function(job, cb) {
} else if (unique) {
var query = job.attrs.unique;
query.name = props.name;
this._db.findAndModify(query, {}, update, {upsert: true, new: true}, processDbResult);
this._db.findAndModify(query, {}, update, {upsert: true, new: true}, processDbResult);
} else {
this._db.insert(props, processDbResult);
}
Expand Down

0 comments on commit b189577

Please sign in to comment.