mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-16 23:40:32 +00:00
15 lines
437 B
TypeScript
15 lines
437 B
TypeScript
import { createClient, RedisClientType } from "redis";
|
|
import { REDIS_RECONNECT_INTERVAL } from "../environment";
|
|
|
|
export default function createRedisClientForRepository() {
|
|
const client = createClient({
|
|
url: process.env.REDIS_URL,
|
|
socket: {
|
|
tls: process.env.NODE_ENV === 'production',
|
|
rejectUnauthorized: false,
|
|
reconnectStrategy: REDIS_RECONNECT_INTERVAL,
|
|
},
|
|
});
|
|
return client as RedisClientType;
|
|
}
|