Skip to content
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.

Commit

Permalink
Updated MongoAscoltatore to MongoDB driver v2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mcollina committed May 29, 2015
1 parent 7c9b77b commit 2fdde66
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
12 changes: 4 additions & 8 deletions lib/mongo_ascoltatore.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ var SubsCounter = require("./subs_counter");
var debug = require("debug")("ascoltatori:mongodb");
var mongo = require('mongodb');
var MongoClient = require('mongodb').MongoClient;
var BSON = mongo.BSONPure;
var ObjectID = require('mongodb').ObjectID;
var async = require("async");

/**
Expand Down Expand Up @@ -46,7 +46,7 @@ var MongoAscoltatore = function(opts) {
this._closed = false;

this._handlingCursorFailure = false;
this._lastSuccessfulHandling = new BSON.ObjectID();
this._lastSuccessfulHandling = new ObjectID();

this.wait = this._opts.wait || 100;

Expand Down Expand Up @@ -76,7 +76,7 @@ var MongoAscoltatore = function(opts) {
debug('ready');

// create a new object id. We will get all the events from now on
that._poll(new BSON.ObjectID());
that._poll(new ObjectID());

that.emit('ready');
}
Expand Down Expand Up @@ -146,11 +146,7 @@ MongoAscoltatore.prototype._handle = function(die, callback) {
err = args.shift();

if (err && !that._closed) {
if (that._cursor && that._cursor.isClosed()) {
that._handleCursorClosed(that._lastSuccessfulHandling);
} else {
that.emit('error', err);
}
that._handleCursorClosed(that._lastSuccessfulHandling);
return;
}

Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"sinon": "^1.10.3",
"sinon-chai": "^2.6.0",
"optimist": "~0.6.0",
"async_bench": "~0.4.0",
"async_bench": "~0.5.0",
"dox-foundation": "0.5.4",
"mosca": "git://github.com/mcollina/mosca.git",
"jshint": "~2.5.2",
Expand All @@ -62,15 +62,15 @@
"async": "~0.9.0",
"debug": "^2.0.0",
"node-uuid": "~1.4.0",
"qlobber": "~0.3.0"
"qlobber": "~0.5.0"
},
"optionalDependencies": {
"nan": "~1.8.4",
"redis": "~0.12.1",
"hiredis": "^0.3.0",
"hiredis": "^0.4.0",
"zmq": "~2.11.0",
"amqp": "~0.2.4",
"mqtt": "~1.0.0",
"mqtt": "^1.0.0",
"mongodb": "~2.0.33",
"eventemitter2": "~0.4.14",
"qlobber-fsq": "~0.3.0"
Expand Down

0 comments on commit 2fdde66

Please sign in to comment.