chore:little fixes and formating and linting and patches
This commit is contained in:
@@ -3,7 +3,7 @@ import type { RedisOptions } from 'ioredis';
|
||||
import { Redis } from 'ioredis';
|
||||
|
||||
const options: RedisOptions = {
|
||||
connectTimeout: 10000,
|
||||
connectTimeout: 10_000,
|
||||
};
|
||||
|
||||
export { Redis };
|
||||
@@ -15,14 +15,14 @@ export interface ExtendedRedis extends Redis {
|
||||
setJson: <T = any>(
|
||||
key: string,
|
||||
expireInSec: number,
|
||||
value: T,
|
||||
value: T
|
||||
) => Promise<void>;
|
||||
}
|
||||
|
||||
const createRedisClient = (
|
||||
name: string,
|
||||
url: string,
|
||||
overrides: RedisOptions = {},
|
||||
overrides: RedisOptions = {}
|
||||
): ExtendedRedis => {
|
||||
const client = new Redis(url, {
|
||||
...options,
|
||||
@@ -55,7 +55,7 @@ const createRedisClient = (
|
||||
client.setJson = async <T = any>(
|
||||
key: string,
|
||||
expireInSec: number,
|
||||
value: T,
|
||||
value: T
|
||||
): Promise<void> => {
|
||||
await client.setex(key, expireInSec, setSuperJson(value));
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user