remove now unused redlock
This commit is contained in:
parent
4735bd12a9
commit
12f2862769
|
@ -29,7 +29,6 @@
|
||||||
"connect-redis": "^6.0.0",
|
"connect-redis": "^6.0.0",
|
||||||
"cookie": "^0.4.1",
|
"cookie": "^0.4.1",
|
||||||
"core-js": "^3.20.2",
|
"core-js": "^3.20.2",
|
||||||
"cors": "^2.8.4",
|
|
||||||
"etag": "^1.8.1",
|
"etag": "^1.8.1",
|
||||||
"express": "^4.17.2",
|
"express": "^4.17.2",
|
||||||
"express-session": "^1.17.2",
|
"express-session": "^1.17.2",
|
||||||
|
@ -59,7 +58,6 @@
|
||||||
"react-stay-scrolled": "^7.4.0",
|
"react-stay-scrolled": "^7.4.0",
|
||||||
"react-toggle-button": "^2.1.0",
|
"react-toggle-button": "^2.1.0",
|
||||||
"redis": "^3.1.2",
|
"redis": "^3.1.2",
|
||||||
"redlock": "^4.0.0",
|
|
||||||
"redux": "^4.1.2",
|
"redux": "^4.1.2",
|
||||||
"redux-logger": "^3.0.6",
|
"redux-logger": "^3.0.6",
|
||||||
"redux-persist": "^6.0.0",
|
"redux-persist": "^6.0.0",
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
import bluebird from 'bluebird';
|
import bluebird from 'bluebird';
|
||||||
import redis from 'redis';
|
import redis from 'redis';
|
||||||
import Redlock from 'redlock';
|
|
||||||
|
|
||||||
import { REDIS_URL } from '../core/config';
|
import { REDIS_URL } from '../core/config';
|
||||||
|
|
||||||
|
@ -10,27 +9,4 @@ bluebird.promisifyAll(redis.RedisClient.prototype);
|
||||||
bluebird.promisifyAll(redis.Multi.prototype);
|
bluebird.promisifyAll(redis.Multi.prototype);
|
||||||
const client = redis.createClient(REDIS_URL, { return_buffers: true });
|
const client = redis.createClient(REDIS_URL, { return_buffers: true });
|
||||||
|
|
||||||
export const redlock = new Redlock(
|
|
||||||
// you should have one redis for each redis node
|
|
||||||
// in your cluster
|
|
||||||
[client],
|
|
||||||
{
|
|
||||||
// the expected clock drift; for more details
|
|
||||||
// see http://redis.io/topics/distlock
|
|
||||||
driftFactor: 0.01, // time in ms
|
|
||||||
|
|
||||||
// the max number of times Redlock will attempt
|
|
||||||
// to lock a resource before erroring
|
|
||||||
retryCount: 5,
|
|
||||||
|
|
||||||
// the time in ms between attempts
|
|
||||||
retryDelay: 200, // time in ms
|
|
||||||
|
|
||||||
// the max time in ms randomly added to retries
|
|
||||||
// to improve performance under high contention
|
|
||||||
// see https://www.awsarchitectureblog.com/2015/03/backoff.html
|
|
||||||
retryJitter: 200, // time in ms
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
export default client;
|
export default client;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user