Files
RSSHub/lib/utils/cache/base.ts
T
Tony c09dacac5b feat(api): add cache probing (#21300)
* feat(api): add cache probing

* fix(tests): correct query parameter from 'path' to 'requestPath' in status tests

* feat(cache): add has to workers kv
2026-03-05 02:36:53 +08:00

19 lines
520 B
TypeScript

import type Redis from 'ioredis';
import type { LRUCache } from 'lru-cache';
type CacheModule = {
init: () => void;
get: (key: string, refresh?: boolean) => Promise<string | null> | string | null;
has: (key: string) => Promise<boolean> | boolean;
set: (key: string, value?: string | Record<string, any>, maxAge?: number) => any;
status: {
available: boolean;
};
clients: {
redisClient?: Redis;
memoryCache?: LRUCache<any, any>;
};
};
export default CacheModule;