Skip to content

Commit

Permalink
timeout because railway hasnt fixed this networking issue bruh
Browse files Browse the repository at this point in the history
  • Loading branch information
Looskie committed Mar 19, 2024
1 parent c403c50 commit a19a330
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions apps/api/src/utils/redis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,22 @@ class Redis {
public static redis: ReturnType<typeof createClient>;

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(
Expand Down

0 comments on commit a19a330

Please sign in to comment.