diff --git a/apps/api/src/utils/redis.ts b/apps/api/src/utils/redis.ts index ba81e7ec..886904b8 100644 --- a/apps/api/src/utils/redis.ts +++ b/apps/api/src/utils/redis.ts @@ -12,20 +12,22 @@ class Redis { public static redis: ReturnType; public static async initialize() { - this.redis = createClient({ - url: env.REDIS_URL, - }); - - this.redis.on("error", (err) => { - Logger.error("INIT", "Failed to connect to redis " + String(err)); - process.exit(1); - }); - - this.redis.on("connect", () => { - Logger.info("INIT", "Connected to redis"); - }); - - await this.redis.connect(); + setTimeout(async () => { + this.redis = createClient({ + url: env.REDIS_URL, + }); + + this.redis.on("error", (err) => { + Logger.error("INIT", "Failed to connect to redis " + String(err)); + process.exit(1); + }); + + this.redis.on("connect", () => { + Logger.info("INIT", "Connected to redis"); + }); + + await this.redis.connect(); + }, 300) } public static async set(