🧊 Added shared Redis config
This commit is contained in:
10
config/redis.config.ts
Normal file
10
config/redis.config.ts
Normal 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 };
|
||||
Reference in New Issue
Block a user