Download packages/cache/src/team-cache.ts from AUXteam/Midday: direct link, hf CLI and curl.
- Browser
- Download file 457 Bytes
-
https://huggingface.co/spaces/AUXteam/Midday/resolve/main/packages/cache/src/team-cache.ts
- Command line
-
hf download hf://spaces/AUXteam/Midday/packages/cache/src/team-cache.ts
-
curl -L -o team-cache.ts https://huggingface.co/spaces/AUXteam/Midday/resolve/main/packages/cache/src/team-cache.ts
457 Bytes
| import { RedisCache } from "./redis-client"; | |
| // Redis-based cache to check if a user has access to a team, shared across all server instances | |
| const cache = new RedisCache("team", 30 * 60); // 30 minutes TTL | |
| export const teamCache = { | |
| get: (key: string): Promise<boolean | undefined> => cache.get<boolean>(key), | |
| set: (key: string, value: boolean): Promise<void> => cache.set(key, value), | |
| delete: (key: string): Promise<void> => cache.delete(key), | |
| }; | |