use logger

This commit is contained in:
Alex Holliday
2025-05-19 11:22:53 -07:00
parent 3ff0f6d399
commit 942104aea2
+11 -2
View File
@@ -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() {