fix: redis connection instantiated out (#5534)
This commit is contained in:
parent
e1380f52ec
commit
73654a25c4
1 changed files with 4 additions and 1 deletions
|
|
@ -126,8 +126,11 @@ export const getExtensions: () => Extension[] = () => {
|
||||||
});
|
});
|
||||||
redisClient.on("ready", () => {
|
redisClient.on("ready", () => {
|
||||||
manualLogger.info("Redis Client connected");
|
manualLogger.info("Redis Client connected");
|
||||||
extensions.push(new HocusPocusRedis({ redis: redisClient }));
|
|
||||||
});
|
});
|
||||||
|
if (!redisClient) {
|
||||||
|
throw new Error("Redis client is not defined");
|
||||||
|
}
|
||||||
|
extensions.push(new HocusPocusRedis({ redis: redisClient }));
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
manualLogger.error("Failed to connect to Redis:", error);
|
manualLogger.error("Failed to connect to Redis:", error);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue