🧊 Added shared Redis config

This commit is contained in:
2023-08-14 22:15:19 -04:00
parent fdcf1f7d68
commit 625447e7f1
2 changed files with 11 additions and 6 deletions

10
config/redis.config.ts Normal file
View File

@@ -0,0 +1,10 @@
import { createClient } from "redis";
const redisURL = new URL(process.env.REDIS_URI);
const pubClient = createClient({ url: `redis://${redisURL.hostname}:6379` });
(async () => {
await pubClient.connect();
})();
const subClient = pubClient.duplicate();
export { subClient, pubClient };