mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-17 13:05:32 +09:00
chore(repo): remove dead code and useless tests (#3375)
This commit is contained in:
1 parent
7e177a1c90
commit
1cd62eb661
1391 files changed
+783
-120415
No files matched your search
-2
@@ -64,8 +64,6 @@ export abstract class ICacheService {
|
||||
|
||||
abstract extendLock(key: string, token: string, ttlSeconds: number): Promise<boolean>;
|
||||
|
||||
abstract getAndRenewTtl<T>(key: string, newTtlSeconds: number): Promise<T | null>;
|
||||
|
||||
abstract publish(channel: string, message: string): Promise<void>;
|
||||
|
||||
abstract sadd(key: string, member: string, ttlSeconds?: number): Promise<void>;
|
||||
|
||||
@@ -226,15 +226,6 @@ export class InMemoryProvider extends ICacheService {
|
||||
return true;
|
||||
}
|
||||
|
||||
async getAndRenewTtl<T>(key: string, newTtlSeconds: number): Promise<T | null> {
|
||||
const entry = this.getValueEntry(key);
|
||||
if (!entry) {
|
||||
return null;
|
||||
}
|
||||
entry.expiresAt = Date.now() + newTtlSeconds * 1000;
|
||||
return entry.value as T;
|
||||
}
|
||||
|
||||
async publish(_channel: string, _message: string): Promise<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -192,12 +192,6 @@ export class KVCacheProvider extends ICacheService {
|
||||
return await this.client.extendLock(lockKey, token, ttlSeconds);
|
||||
}
|
||||
|
||||
async getAndRenewTtl<T>(key: string, newTtlSeconds: number): Promise<T | null> {
|
||||
const value = await this.client.getex(key, newTtlSeconds);
|
||||
if (value == null) return null;
|
||||
return safeJsonParse<T>(value, this.logger);
|
||||
}
|
||||
|
||||
async publish(channel: string, message: string): Promise<void> {
|
||||
await this.client.publish(channel, message);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user