mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2024-11-10 09:07:47 +01:00
Merge pull request #481 from mchangrh/update-deps
update dependencies, use native redis typings
This commit is contained in:
commit
356edb1f4b
3 changed files with 1388 additions and 2837 deletions
4173
package-lock.json
generated
4173
package-lock.json
generated
File diff suppressed because it is too large
Load diff
44
package.json
44
package.json
|
@ -18,38 +18,38 @@
|
|||
"author": "Ajay Ramachandran",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"axios": "^0.24.0",
|
||||
"better-sqlite3": "^7.4.5",
|
||||
"cron": "^1.8.2",
|
||||
"express": "^4.17.1",
|
||||
"axios": "^0.27.2",
|
||||
"better-sqlite3": "^7.6.0",
|
||||
"cron": "^2.0.0",
|
||||
"express": "^4.18.1",
|
||||
"express-promise-router": "^4.1.1",
|
||||
"express-rate-limit": "^6.3.0",
|
||||
"express-rate-limit": "^6.4.0",
|
||||
"lodash": "^4.17.21",
|
||||
"pg": "^8.7.1",
|
||||
"pg": "^8.7.3",
|
||||
"rate-limit-redis": "^3.0.1",
|
||||
"redis": "^4.0.6",
|
||||
"redis": "^4.2.0",
|
||||
"sync-mysql": "^3.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/better-sqlite3": "^7.4.1",
|
||||
"@types/cron": "^1.7.3",
|
||||
"@types/better-sqlite3": "^7.5.0",
|
||||
"@types/cron": "^2.0.0",
|
||||
"@types/express": "^4.17.13",
|
||||
"@types/lodash": "^4.14.178",
|
||||
"@types/mocha": "^9.0.0",
|
||||
"@types/node": "^16.11.11",
|
||||
"@types/pg": "^8.6.1",
|
||||
"@typescript-eslint/eslint-plugin": "^5.5.0",
|
||||
"@typescript-eslint/parser": "^5.5.0",
|
||||
"eslint": "^8.3.0",
|
||||
"mocha": "^9.1.3",
|
||||
"nodemon": "^2.0.15",
|
||||
"@types/lodash": "^4.14.182",
|
||||
"@types/mocha": "^9.1.1",
|
||||
"@types/node": "^18.0.3",
|
||||
"@types/pg": "^8.6.5",
|
||||
"@typescript-eslint/eslint-plugin": "^5.30.6",
|
||||
"@typescript-eslint/parser": "^5.30.6",
|
||||
"eslint": "^8.19.0",
|
||||
"mocha": "^10.0.0",
|
||||
"nodemon": "^2.0.19",
|
||||
"nyc": "^15.1.0",
|
||||
"sinon": "^12.0.1",
|
||||
"sinon": "^14.0.0",
|
||||
"ts-mock-imports": "^1.3.8",
|
||||
"ts-node": "^10.4.0",
|
||||
"typescript": "^4.5.2"
|
||||
"ts-node": "^10.8.2",
|
||||
"typescript": "^4.7.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
"node": ">=16"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { config } from "../config";
|
||||
import { Logger } from "./logger";
|
||||
import { createClient } from "redis";
|
||||
import { RedisCommandArgument, RedisCommandArguments, RedisCommandRawReply } from "@node-redis/client/dist/lib/commands";
|
||||
import { ClientCommandOptions } from "@node-redis/client/dist/lib/client";
|
||||
import { RedisCommandArgument, RedisCommandArguments, RedisCommandRawReply } from "@redis/client/dist/lib/commands";
|
||||
import { RedisClientOptions } from "@redis/client/dist/lib/client";
|
||||
import { RedisReply } from "rate-limit-redis";
|
||||
|
||||
interface RedisSB {
|
||||
|
@ -11,7 +11,7 @@ interface RedisSB {
|
|||
setEx(key: RedisCommandArgument, seconds: number, value: RedisCommandArgument): Promise<string>;
|
||||
del(...keys: [RedisCommandArgument]): Promise<number>;
|
||||
increment?(key: RedisCommandArgument): Promise<RedisCommandRawReply[]>;
|
||||
sendCommand(args: RedisCommandArguments, options?: ClientCommandOptions): Promise<RedisReply>;
|
||||
sendCommand(args: RedisCommandArguments, options?: RedisClientOptions): Promise<RedisReply>;
|
||||
quit(): Promise<void>;
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,7 @@ if (config.redis?.enabled) {
|
|||
Logger.info("Connected to redis");
|
||||
const client = createClient(config.redis);
|
||||
client.connect();
|
||||
exportClient = client;
|
||||
exportClient = client as RedisSB;
|
||||
|
||||
const timeoutDuration = 40;
|
||||
const get = client.get.bind(client);
|
||||
|
|
Loading…
Reference in a new issue