Skip to content
This repository has been archived by the owner on Nov 6, 2019. It is now read-only.

Commit

Permalink
Merge pull request #53 from dhritzkiv/mongoskin2
Browse files Browse the repository at this point in the history
Update to mongoskin v2
  • Loading branch information
scttnlsn committed Oct 1, 2015
2 parents a320b58 + bcc8680 commit d0087e4
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 29 deletions.
6 changes: 3 additions & 3 deletions lib/queue.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Queue.prototype.get = function (id, callback) {
var self = this;

if (typeof id === 'string') {
id = new mongoskin.BSONPure.ObjectID(id);
id = new mongoskin.helper.toObjectID(id);
}

this.collection.findOne({ _id: id, queue: this.name }, function (err, data) {
Expand Down Expand Up @@ -91,9 +91,9 @@ Queue.prototype.dequeue = function (options, callback) {

this.collection.findAndModify(query, sort, update, options, function (err, doc) {
if (err) return callback(err);
if (!doc) return callback();
if (!doc || !doc.value) return callback();

callback(null, self.job(doc));
callback(null, self.job(doc.value));
});
};

Expand Down
47 changes: 22 additions & 25 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,24 @@
{
"name": "monq",
"version": "0.3.2",
"description": "MongoDB-backed job queue for Node.js",
"homepage": "http://github.com/scttnlsn/monq",
"author": "Scott Nelson <[email protected]>",
"main": "./lib/index",

"scripts": {
"test": "./node_modules/.bin/mocha"
},

"repository": {
"type": "git",
"url": "git://github.com/scttnlsn/monq.git"
},

"dependencies": {
"mongoskin": "1.4.13"
},

"devDependencies": {
"async": "0.2.10",
"mocha": "1.18.2",
"sinon": "1.9.0"
}
"name": "monq",
"version": "0.3.2",
"description": "MongoDB-backed job queue for Node.js",
"homepage": "http://github.com/scttnlsn/monq",
"author": "Scott Nelson <[email protected]>",
"main": "./lib/index",
"scripts": {
"test": "./node_modules/.bin/mocha"
},
"repository": {
"type": "git",
"url": "git://github.com/scttnlsn/monq.git"
},
"dependencies": {
"mongodb": "^2.0.44",
"mongoskin": "^2.0.0"
},
"devDependencies": {
"async": "0.2.10",
"mocha": "1.18.2",
"sinon": "1.9.0"
}
}
2 changes: 1 addition & 1 deletion test/test_queue.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,4 @@ describe('Queue', function () {
});
});
});
});
});

0 comments on commit d0087e4

Please sign in to comment.