chore: update clients to be env vars
This commit is contained in:
10
src/index.ts
10
src/index.ts
@@ -62,8 +62,14 @@ setGlobalDispatcher(
|
||||
|
||||
require('dotenv').config();
|
||||
|
||||
// Reading in Redis env vars
|
||||
const REDIS_CLIENTS = [RedisClientPrefix.DLOB, RedisClientPrefix.DLOB_HELIUS];
|
||||
const envClients = [];
|
||||
const clients = process.env.REDIS_CLIENT.trim()
|
||||
.replace(/^\[|\]$/g, '')
|
||||
.split(/\s*,\s*/);
|
||||
|
||||
clients.forEach((client) => envClients.push(RedisClientPrefix[client]));
|
||||
|
||||
const REDIS_CLIENTS = envClients.length ? envClients : [RedisClientPrefix.DLOB, RedisClientPrefix.DLOB_HELIUS];
|
||||
console.log('Redis Clients:', REDIS_CLIENTS);
|
||||
|
||||
const driftEnv = (process.env.ENV || 'devnet') as DriftEnv;
|
||||
|
||||
Reference in New Issue
Block a user