Merge pull request #281 from drift-labs/jack/env-clients
chore: null checks
This commit is contained in:
@@ -63,11 +63,11 @@ setGlobalDispatcher(
|
||||
require('dotenv').config();
|
||||
|
||||
const envClients = [];
|
||||
const clients = process.env.REDIS_CLIENT.trim()
|
||||
const clients = process.env.REDIS_CLIENT?.trim()
|
||||
.replace(/^\[|\]$/g, '')
|
||||
.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];
|
||||
console.log('Redis Clients:', REDIS_CLIENTS);
|
||||
|
||||
@@ -39,11 +39,11 @@ require('dotenv').config();
|
||||
|
||||
// Reading in Redis env vars
|
||||
const envClients = [];
|
||||
const clients = process.env.REDIS_CLIENT.trim()
|
||||
const clients = process.env.REDIS_CLIENT?.trim()
|
||||
.replace(/^\[|\]$/g, '')
|
||||
.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];
|
||||
console.log('Redis Clients:', REDIS_CLIENTS);
|
||||
|
||||
Reference in New Issue
Block a user