* fix: initialize redis client and pass it to hocuspocus * chore: renamed func * fix: yarn lock
15 lines
367 B
TypeScript
15 lines
367 B
TypeScript
export function getRedisUrl() {
|
|
const redisUrl = process.env.REDIS_URL?.trim();
|
|
const redisHost = process.env.REDIS_HOST?.trim();
|
|
const redisPort = process.env.REDIS_PORT?.trim();
|
|
|
|
if (redisUrl) {
|
|
return redisUrl;
|
|
}
|
|
|
|
if (redisHost && redisPort && !Number.isNaN(Number(redisPort))) {
|
|
return `redis://${redisHost}:${redisPort}`;
|
|
}
|
|
|
|
return "";
|
|
}
|