diegosouzapw/OmniRoute · error · Error

Redis is not configured

Error message

Redis is not configured

What it means

Error "Redis is not configured" thrown in diegosouzapw/OmniRoute.

Source

Thrown at src/shared/utils/rateLimiter.ts:68

  };
}

const redisLogThrottle = createRedisLogThrottle();

// Exposed for unit tests — returns a fresh, isolated throttle instance.
export function _createRedisLogThrottleForTests() {
  return createRedisLogThrottle();
}

/**
 * Return the singleton Redis client, creating it (lazily importing `ioredis`)
 * on first call. Throws SYNCHRONOUSLY (not a rejected Promise) when Redis is
 * not configured — callers rely on this to fail fast without an `await`.
 * Otherwise returns a Promise that resolves once the client is constructed.
 */
export function getRedisClient(): Promise<Redis> {
  if (!isRedisConfigured()) {
    throw new Error("Redis is not configured");
  }

  if (!redisClientPromise) {
    redisClientPromise = (async () => {
      // Lazy dynamic import — see the #6559 note above the singleton declaration.
      const mod = await import("ioredis");
      const RedisCtor = (mod.default ?? mod) as typeof Redis;
      const client = new RedisCtor(REDIS_URL, {
        maxRetriesPerRequest: 3,
        enableReadyCheck: false,
        keyPrefix: REDIS_KEY_PREFIX,
        retryStrategy(times) {
          return Math.min(times * 50, 2000); // Exponential backoff
        },
      });
      client.on("error", (err) => {
        // Throttle: log once per error-state change instead of on every retry (#4878).
        if (redisLogThrottle.shouldLog(err.message)) {

View on GitHub (pinned to a179ffed5b)

When it happens

Trigger: Thrown at src/shared/utils/rateLimiter.ts:68 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25). Data as JSON: /api/errors/12e1744238a3d5d0. Report an issue: GitHub.