Files
nerandClaude Fable 5 131beeb07f feat(tlk): persist Toloka session in Redis across cold starts
Store the serialized cookie jar in Upstash Redis after login and
restore it on instance start, so serverless cold starts reuse the
session instead of re-authenticating. Falls back to the previous
in-memory behavior when Redis is not configured or unavailable.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-06 21:02:13 +03:00

11 lines
300 B
TypeScript

import { Redis } from '@upstash/redis';
import { UPSTASH_REDIS_REST_TOKEN, UPSTASH_REDIS_REST_URL } from '@/env';
const redis =
UPSTASH_REDIS_REST_URL && UPSTASH_REDIS_REST_TOKEN
? new Redis({ url: UPSTASH_REDIS_REST_URL, token: UPSTASH_REDIS_REST_TOKEN })
: null;
export default redis;