Socket
Socket
Sign inDemoInstall

gridfs-locks

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gridfs-locks - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

4

HISTORY.md

@@ -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 @@

6

index.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc