const redis = require("./redisClient"); const initializeRedis = async () => { if (redis.status === "wait") await redis.connect(); if (redis.status !== "ready") await redis.ping(); }; const checkRedis = async () => { try { return (await redis.ping()) === "PONG"; } catch (_error) { return false; } }; const closeRedis = async () => { if (redis.status !== "end") await redis.quit(); }; module.exports = { initializeRedis, checkRedis, closeRedis };