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 0.0.1 to 0.0.2

2

package.json
{
"name": "gridfs-locks",
"version": "0.0.1",
"version": "0.0.2",
"description": "Distributed read/write locking based on MongoDB, primarily designed to make GridFS safe for concurrent access",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -94,3 +94,3 @@ # gridfs-locks

As with any locking scheme, care must be taken to avoid creating [deadlocks](https://en.wikipedia.org/wiki/Deadlocks), and the built-in lock expiration pattern may be helpful in doing so. Note that the default configuration is that locks never expire, and attempts to obtain unavailable locks return immediately without a valid lock. These behaviors may be changed using the `lockExpiration`, `timeOut` and `pollingInterval` options.
As with any locking scheme, care must be taken to avoid creating [deadlocks](https://en.wikipedia.org/wiki/Deadlocks), and the built-in lock expiration pattern may be helpful in doing so. Note that the default configuration is that locks never expire, and attempts to obtain unavailable locks invoke the callback immediately without waiting for a lock. These behaviors may be changed using the `lockExpiration`, `timeOut` and `pollingInterval` options.

@@ -111,3 +111,3 @@ ## API

pollingInterval: 5, // seconds between successive attempts to acquire a lock while waiting Default: 5 sec
metaData: // metadata to store in the lock documents, useful for debugging Default: null
metaData: null // metadata to store in the lock documents, useful for debugging Default: null
w: 1 // mongodb write-concern Default: 1

@@ -134,3 +134,3 @@ },

pollingInterval: 5, // seconds between successive attempts to acquire a lock while waiting Default: 5 sec
metaData: // metadata to store in the lock document, useful for debugging Default: null
metaData: null // metadata to store in the lock document, useful for debugging Default: null
}

@@ -159,3 +159,3 @@ );

```js
lock.obtainReadLock(
lock.obtainWriteLock(
function (err, l) {

@@ -183,3 +183,3 @@ // err: any database error

Reset the lock expiration time to `lockExpiration` seconds from now.
Need more time? Reset the lock expiration time to `lockExpiration` seconds from now.

@@ -186,0 +186,0 @@ ```js

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