redis-semaphore
Advanced tools
Comparing version
@@ -6,8 +6,2 @@ const RedisMutex = require('./RedisMutex') | ||
const DEFAULT_TIMEOUTS = { | ||
lockTimeout: 10000, | ||
acquireTimeout: 10000, | ||
retryInterval: 10 | ||
} | ||
class RedisFairSemaphore extends RedisMutex { | ||
@@ -19,7 +13,7 @@ constructor( | ||
{ | ||
lockTimeout, | ||
acquireTimeout, | ||
retryInterval, | ||
lockTimeout = 10000, | ||
acquireTimeout = 10000, | ||
retryInterval = 10, | ||
refreshInterval | ||
} = DEFAULT_TIMEOUTS | ||
} = {} | ||
) { | ||
@@ -26,0 +20,0 @@ super(client, key, { |
@@ -8,8 +8,2 @@ const Redis = require('ioredis') | ||
const DEFAULT_TIMEOUTS = { | ||
lockTimeout: 10000, | ||
acquireTimeout: 10000, | ||
retryInterval: 10 | ||
} | ||
class RedisMutex { | ||
@@ -20,7 +14,7 @@ constructor( | ||
{ | ||
lockTimeout, | ||
acquireTimeout, | ||
retryInterval, | ||
lockTimeout = 10000, | ||
acquireTimeout = 10000, | ||
retryInterval = 10, | ||
refreshInterval | ||
} = DEFAULT_TIMEOUTS | ||
} = {} | ||
) { | ||
@@ -27,0 +21,0 @@ if (!client) { |
@@ -6,8 +6,2 @@ const RedisMutex = require('./RedisMutex') | ||
const DEFAULT_TIMEOUTS = { | ||
lockTimeout: 10000, | ||
acquireTimeout: 10000, | ||
retryInterval: 10 | ||
} | ||
class RedisSemaphore extends RedisMutex { | ||
@@ -19,7 +13,7 @@ constructor( | ||
{ | ||
lockTimeout, | ||
acquireTimeout, | ||
retryInterval, | ||
lockTimeout = 10000, | ||
acquireTimeout = 10000, | ||
retryInterval = 10, | ||
refreshInterval | ||
} = DEFAULT_TIMEOUTS | ||
} = {} | ||
) { | ||
@@ -26,0 +20,0 @@ super(client, key, { |
{ | ||
"name": "redis-semaphore", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Distributed mutex and semaphore based on Redis", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -21,3 +21,3 @@ # redis-semaphore | ||
```bash | ||
npm install redis-semaphore ioredis | ||
npm install --save redis-semaphore ioredis | ||
# or | ||
@@ -119,10 +119,2 @@ yarn add redis-semaphore ioredis | ||
## Installation | ||
```bash | ||
npm install --save redis-semaphore | ||
# or | ||
yarn add redis-semaphore | ||
``` | ||
## License | ||
@@ -129,0 +121,0 @@ |
127503
-0.28%668
-2.2%134
-5.63%