Skip to content

Commit

Permalink
chore: null checks
Browse files Browse the repository at this point in the history
  • Loading branch information
jackwaller committed Nov 21, 2024
1 parent 4b9b337 commit e4a78db
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/serverLite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit e4a78db

Please sign in to comment.