chore: null checks
This commit is contained in:
@@ -63,11 +63,11 @@ setGlobalDispatcher(
|
|||||||
require('dotenv').config();
|
require('dotenv').config();
|
||||||
|
|
||||||
const envClients = [];
|
const envClients = [];
|
||||||
const clients = process.env.REDIS_CLIENT.trim()
|
const clients = process.env.REDIS_CLIENT?.trim()
|
||||||
.replace(/^\[|\]$/g, '')
|
.replace(/^\[|\]$/g, '')
|
||||||
.split(/\s*,\s*/);
|
.split(/\s*,\s*/);
|
||||||
|
|
||||||
clients.forEach((client) => envClients.push(RedisClientPrefix[client]));
|
clients?.forEach((client) => envClients.push(RedisClientPrefix[client]));
|
||||||
|
|
||||||
const REDIS_CLIENTS = envClients.length ? envClients : [RedisClientPrefix.DLOB, RedisClientPrefix.DLOB_HELIUS];
|
const REDIS_CLIENTS = envClients.length ? envClients : [RedisClientPrefix.DLOB, RedisClientPrefix.DLOB_HELIUS];
|
||||||
console.log('Redis Clients:', REDIS_CLIENTS);
|
console.log('Redis Clients:', REDIS_CLIENTS);
|
||||||
|
|||||||
@@ -39,11 +39,11 @@ require('dotenv').config();
|
|||||||
|
|
||||||
// Reading in Redis env vars
|
// Reading in Redis env vars
|
||||||
const envClients = [];
|
const envClients = [];
|
||||||
const clients = process.env.REDIS_CLIENT.trim()
|
const clients = process.env.REDIS_CLIENT?.trim()
|
||||||
.replace(/^\[|\]$/g, '')
|
.replace(/^\[|\]$/g, '')
|
||||||
.split(/\s*,\s*/);
|
.split(/\s*,\s*/);
|
||||||
|
|
||||||
clients.forEach((client) => envClients.push(RedisClientPrefix[client]));
|
clients?.forEach((client) => envClients.push(RedisClientPrefix[client]));
|
||||||
|
|
||||||
const REDIS_CLIENTS = envClients.length ? envClients : [RedisClientPrefix.DLOB, RedisClientPrefix.DLOB_HELIUS];
|
const REDIS_CLIENTS = envClients.length ? envClients : [RedisClientPrefix.DLOB, RedisClientPrefix.DLOB_HELIUS];
|
||||||
console.log('Redis Clients:', REDIS_CLIENTS);
|
console.log('Redis Clients:', REDIS_CLIENTS);
|
||||||
|
|||||||
Reference in New Issue
Block a user