refactor: atualizações e remoção de módulos não utilizados
This commit is contained in:
10
src/core/configs/cache/redis-client.adapter.ts
vendored
10
src/core/configs/cache/redis-client.adapter.ts
vendored
@@ -6,13 +6,13 @@ import { IRedisClient } from './IRedisClient';
|
||||
export class RedisClientAdapter implements IRedisClient {
|
||||
constructor(
|
||||
@Inject('REDIS_CLIENT')
|
||||
private readonly redis: Redis
|
||||
private readonly redis: Redis,
|
||||
) {}
|
||||
|
||||
async get<T>(key: string): Promise<T | null> {
|
||||
const data = await this.redis.get(key);
|
||||
if (!data) return null;
|
||||
|
||||
|
||||
try {
|
||||
return JSON.parse(data);
|
||||
} catch (error) {
|
||||
@@ -43,7 +43,11 @@ export class RedisClientAdapter implements IRedisClient {
|
||||
return this.redis.ttl(key);
|
||||
}
|
||||
|
||||
async eval(script: string, numKeys: number, ...keysAndArgs: (string | number)[]): Promise<any> {
|
||||
async eval(
|
||||
script: string,
|
||||
numKeys: number,
|
||||
...keysAndArgs: (string | number)[]
|
||||
): Promise<any> {
|
||||
return this.redis.eval(script, numKeys, ...keysAndArgs);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user