mirror of
https://github.com/tornadocash/tornado-relayer
synced 2024-02-02 15:04:06 +01:00
dependencies upgrade
This commit is contained in:
parent
a35207eabc
commit
3a74ebf90e
11
package.json
11
package.json
@ -4,17 +4,12 @@
|
|||||||
"description": "Relayer for Tornado.cash privacy solution. https://tornado.cash",
|
"description": "Relayer for Tornado.cash privacy solution. https://tornado.cash",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev:app": "nodemon --watch './src/**/*.ts' --exec ts-node src/app/index.ts",
|
"dev:app": "nodemon --watch './src/**/*.ts' --exec ts-node src/app/index.ts",
|
||||||
"server": "node src/app/server.ts",
|
"dev:worker": "nodemon --watch './src/**/*.ts' --exec ts-node src/worker.ts",
|
||||||
"worker": "node src/worker",
|
|
||||||
"treeWatcher": "node src/treeWatcher",
|
|
||||||
"priceWatcher": "node src/priceWatcher",
|
|
||||||
"healthWatcher": "node src/healthWatcher",
|
|
||||||
"eslint": "eslint --ext .js --ignore-path .gitignore .",
|
"eslint": "eslint --ext .js --ignore-path .gitignore .",
|
||||||
"prettier:check": "npx prettier --check . --config .prettierrc",
|
"prettier:check": "npx prettier --check . --config .prettierrc",
|
||||||
"prettier:fix": "npx prettier --write . --config .prettierrc",
|
"prettier:fix": "npx prettier --write . --config .prettierrc",
|
||||||
"lint": "yarn eslint && yarn prettier:check",
|
"lint": "yarn eslint && yarn prettier:check",
|
||||||
"test": "mocha",
|
"test": "mocha"
|
||||||
"start": "yarn server & yarn priceWatcher & yarn treeWatcher & yarn worker & yarn healthWatcher"
|
|
||||||
},
|
},
|
||||||
"author": "tornado.cash",
|
"author": "tornado.cash",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@ -28,7 +23,7 @@
|
|||||||
"ethers": "^5.6.4",
|
"ethers": "^5.6.4",
|
||||||
"fastify": "^3.28.0",
|
"fastify": "^3.28.0",
|
||||||
"gas-price-oracle": "^0.4.6",
|
"gas-price-oracle": "^0.4.6",
|
||||||
"ioredis": "^4.14.1",
|
"ioredis": "^5.0.6",
|
||||||
"json-schema-to-ts": "^2.2.0",
|
"json-schema-to-ts": "^2.2.0",
|
||||||
"node-fetch": "^2.6.7",
|
"node-fetch": "^2.6.7",
|
||||||
"reflect-metadata": "^0.1.13",
|
"reflect-metadata": "^0.1.13",
|
||||||
|
@ -1,25 +1,28 @@
|
|||||||
import Redis from 'ioredis';
|
import IORedis, { Redis } from 'ioredis';
|
||||||
import { redisUrl } from '../config';
|
import { redisUrl } from '../config';
|
||||||
import { container, singleton } from 'tsyringe';
|
import { container, singleton } from 'tsyringe';
|
||||||
|
|
||||||
|
const getNewInstance: () => Redis = () => new IORedis(redisUrl, { maxRetriesPerRequest: null });
|
||||||
|
|
||||||
@singleton()
|
@singleton()
|
||||||
export class RedisStore {
|
export class RedisStore {
|
||||||
get client(): Redis.Redis {
|
get client() {
|
||||||
|
if (!this._client) {
|
||||||
|
this._client = getNewInstance();
|
||||||
|
}
|
||||||
return this._client;
|
return this._client;
|
||||||
}
|
}
|
||||||
|
|
||||||
get subscriber(): Redis.Redis {
|
get subscriber() {
|
||||||
|
if (!this._subscriber) {
|
||||||
|
this._subscriber = getNewInstance();
|
||||||
|
}
|
||||||
return this._subscriber;
|
return this._subscriber;
|
||||||
}
|
}
|
||||||
|
|
||||||
private readonly _subscriber: Redis.Redis;
|
_subscriber: Redis;
|
||||||
private readonly _client: Redis.Redis;
|
_client: Redis;
|
||||||
|
|
||||||
constructor() {
|
|
||||||
this._client = new Redis(redisUrl, { maxRetriesPerRequest: null });
|
|
||||||
this._subscriber = new Redis(redisUrl, { maxRetriesPerRequest: null });
|
|
||||||
console.log('RedisStore new instance');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default () => container.resolve(RedisStore);
|
export default () => container.resolve(RedisStore);
|
||||||
|
Loading…
Reference in New Issue
Block a user