use logger
This commit is contained in:
1 parent
3ff0f6d399
commit
942104aea2
1 file changed
+11
-2
@@ -22,13 +22,22 @@ class RedisService {
|
||||
async closeAllConnections() {
|
||||
const closePromises = Array.from(this.connections).map((conn) =>
|
||||
conn.quit().catch((err) => {
|
||||
console.error("Error closing Redis connection:", err);
|
||||
this.logger.error({
|
||||
message: "Error closing Redis connection",
|
||||
service: SERVICE_NAME,
|
||||
method: "closeAllConnections",
|
||||
details: { error: err },
|
||||
});
|
||||
})
|
||||
);
|
||||
|
||||
await Promise.all(closePromises);
|
||||
this.connections.clear();
|
||||
console.log("All Redis connections closed");
|
||||
this.logger.info({
|
||||
message: "All Redis connections closed",
|
||||
service: SERVICE_NAME,
|
||||
method: "closeAllConnections",
|
||||
});
|
||||
}
|
||||
|
||||
async flushRedis() {
|
||||
|
||||
Reference in new issue
Block a user