{
  "id": 23107793,
  "title": "One nullable Redis client, three callers, and three different answers to \"Redis is not configured\"",
  "url": "https://urgent.news/2026/12/02/one-nullable-redis-client-three-callers-and-three-different-answers",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-12-02T11:06:08.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/daniel_pertu/one-nullable-redis-client-three-callers-and-three-different-answers-to-redis-is-not-configured-28e5"
  },
  "original_language": null,
  "account": "The Redis helper in Nakodo is a short function that returns an Upstash client when specific environment variables are set, or null otherwise. This null value is the default on laptops and preview deployments. The function can return null, causing different behaviors in its three callers and one script.\n\n1. The rate limiter, found in src/lib/ratelimit.ts, returns null when there is no Redis, allowing requests to proceed without limitation. A comment explains that this prevents sign-in from being blocked if Redis is missing or broken. In case of failure, a one-second delay allows the request to go through, with a logged error. An asymmetry exists: on a live deployment without Redis, a log message is displayed, while locally, no log is shown.\n\n2. The place search, located in src/lib/places/geocode.ts, uses Redis to limit requests to one per second. If Redis is unavailable, a Map and timestamp are used to limit requests per process. This approach is different from the first one, as it limits requests per process instead of globally, avoiding potential issues with third-party limits.\n\n3. The sitemap announcer, found in src/lib/seo/indexnow.ts, runs hourly and notifies search engines about pages with updated dates. When Redis is not configured, it returns a message indicating that Redis isn't configured and skips announcing pages. This approach, called \"fail closed,\" prevents unnecessary noise in search engines' systems but may lead to re-announcing all pages every hour if Redis were available.",
  "summary": "The Redis helper in Nakodo is twelve lines. It returns an Upstash client when the environment has either the UPSTASH_REDIS_REST_* pair or the KV_REST_API_* pair that Vercel's integration sets, and null otherwise. Null is the default on a laptop and on a preview deployment. export function redisFromEnv ( ) : Redis | null { const configured = ( env ( \"UPSTASH_REDIS_REST_URL\" ) || env (…",
  "summary_source": "publisher",
  "key_points": [
    "The Redis helper returns null when not configured, affecting three callers differently",
    "Rate limiter allows requests without limitation on missing Redis, with one-second delay on failure",
    "Sitemap announcer returns configuration message and skips announcing pages when Redis is unavailable"
  ],
  "editors_take": null,
  "opinion": false,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "outlets_capped": false,
    "also_reported_by": []
  },
  "machine_translated": false,
  "ai_generated": true,
  "disclaimer": "Accounts, briefs, key points, the editor’s take and translations are written by software from other outlets’ reporting and may contain errors. A summary whose summary_source is \"publisher\" is the outlet’s own feed text. Always check the linked original."
}