Spaces:
Runtime error
Runtime error
Download src/lib/redis.ts from dvijaykrishnan/vault-video-processor: direct link, hf CLI and curl.
- Browser
- Download file 632 Bytes
-
https://huggingface.co/spaces/dvijaykrishnan/vault-video-processor/resolve/main/src/lib/redis.ts
- Command line
-
hf download hf://spaces/dvijaykrishnan/vault-video-processor/src/lib/redis.ts
-
curl -L -o redis.ts https://huggingface.co/spaces/dvijaykrishnan/vault-video-processor/resolve/main/src/lib/redis.ts
632 Bytes
| import { Redis } from '@upstash/redis'; | |
| // No-op client for local dev when Upstash isn't configured. | |
| // All cache reads return null (fall through to DB), writes are skipped. | |
| const noopRedis = { | |
| get: async () => null, | |
| set: async () => null, | |
| del: async () => null, | |
| incr: async () => 1, | |
| expire: async () => null, | |
| } as unknown as Redis; | |
| export const redis: Redis = | |
| process.env.UPSTASH_REDIS_REST_URL && process.env.UPSTASH_REDIS_REST_TOKEN | |
| ? new Redis({ | |
| url: process.env.UPSTASH_REDIS_REST_URL, | |
| token: process.env.UPSTASH_REDIS_REST_TOKEN, | |
| }) | |
| : noopRedis; | |