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.2.0 to 1.2.1

5

HISTORY.md

@@ -0,1 +1,6 @@

### 1.2.1
- Fixed errors stemming from improper checking of the mongo error code in an emitted error object.
- Ensure that lockExpiration >= pollingInterval, or expirations may become instantaneous
### 1.2.0

@@ -2,0 +7,0 @@

21

index.js

@@ -126,2 +126,8 @@ /***********************************************************************

self.lockExpiration = 1000*(options.lockExpiration || self.lockCollection.lockExpiration);
// This ensures that locks don't emit expirations immediately
if (self.lockExpiration && self.lockExpiration < self.pollingInterval * 1.1) {
self.lockExpiration = self.pollingInterval * 1.1
}
self.lockExpireTime = new Date(self.timeCreated.getTime() + (self.lockExpiration || never));

@@ -135,2 +141,3 @@ self.timeOut = 1000*(options.timeOut || self.lockCollection.timeOut);

self.expired = false;
return self;

@@ -462,7 +469,4 @@ };

function (err, doc) {
// if (err) { console.log("ERROR:", err); }
//
// XXX: Handle unique index exception when simultaneous upserts collide...
//
if (err && ((err.name !== 'MongoError') || (err.lastErrorObject.code !== 11000))) { return emitError(self, err); }
// if (err) { console.log("Error", err)}
if (err && ((err.name !== 'MongoError') || (err.code !== 11000))) { return emitError(self, err); }
if (!doc) {

@@ -521,7 +525,4 @@ if (new Date().getTime() - self.timeCreated >= self.timeOut) {

function (err, doc) {
// if (err) { console.log("ERROR:", err); }
//
// XXX: Handle unique index exception when simultaneous upserts collide...
//
if (err && ((err.name !== 'MongoError') || (err.lastErrorObject.code !== 11000))) { return emitError(self, err); }
// if (err) { console.log("Error", err)}
if (err && ((err.name !== 'MongoError') || (err.code !== 11000))) { return emitError(self, err); }
if (doc) {

@@ -528,0 +529,0 @@ self.heldLock = doc;

{
"name": "gridfs-locks",
"version": "1.2.0",
"version": "1.2.1",
"description": "Distributed read/write locking based on MongoDB, designed to make GridFS safe for concurrent access",

@@ -8,3 +8,3 @@ "main": "index.js",

"devDependencies": {
"mongodb": ">=1.4.2",
"mongodb": ">=1.4.3",
"coffee-script": "*",

@@ -11,0 +11,0 @@ "mocha": "*"

Sorry, the diff of this file is not supported yet

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