gridfs-locks
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -0,1 +1,5 @@ | ||
### 1.1.1 | ||
- Revert from use of MongoDB 2.6 only $currentDate update modifier to maintain compatibility with mongo 2.4.x | ||
### 1.1.0 | ||
@@ -2,0 +6,0 @@ |
@@ -200,3 +200,3 @@ /*********************************************************************** | ||
query = {files_id: self.fileId, write_lock: true}, | ||
update = {$set: {write_lock: false, meta: null}, $currentDate: { expires: true }}; | ||
update = {$set: {write_lock: false, expires: new Date(), meta: null}}; | ||
@@ -224,6 +224,6 @@ } else { | ||
// may be inheritied by a new read lock, but the window should be short enough that this is tolerable | ||
// because the lock->unlock->lock order of operations could have easily have been lock->lock->unlock | ||
// because the lock->unlock->lock order of operations could just as easily have been lock->lock->unlock | ||
if ((lt === 'r') && doc && (doc.read_locks == 0)) { | ||
query = {files_id: self.fileId, read_locks: 0, write_lock: false}; | ||
update = {$currentDate: { expires: true }}; | ||
update = {$set: { expires: new Date() }}; | ||
self.collection.findAndModify(query, [], update, {w: self.lockCollection.writeConcern, new: true}, function (err, doc) { | ||
@@ -230,0 +230,0 @@ if (err) { console.warn("Error returned from expiration time reset on release", err); } |
{ | ||
"name": "gridfs-locks", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Distributed read/write locking based on MongoDB, designed to make GridFS safe for concurrent access", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -20,3 +20,3 @@ # gridfs-locks | ||
To run unit tests (requres mongodb server on `localhost:27017`): | ||
To run unit tests (requires mongodb server on `localhost:27017`): | ||
@@ -23,0 +23,0 @@ npm test |
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
72598