From ca92fa75b6ad78fe740bc7acb3ac7d556846bc7e Mon Sep 17 00:00:00 2001 From: Nicholas Frederiksen Date: Mon, 18 Nov 2024 16:25:47 +0100 Subject: [PATCH] Add envvar for adjusting redis pool size (#318) * chore: new envvar for redis pool size, default 30 * set default pool size to 15 --- engine/redis_state_store.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/engine/redis_state_store.js b/engine/redis_state_store.js index e9d92ba..88f401c 100644 --- a/engine/redis_state_store.js +++ b/engine/redis_state_store.js @@ -10,6 +10,7 @@ function isTrue(s) { } const REDIS_VERBOSE_LOG = process.env.REDIS_VERBOSE_LOG ? isTrue(process.env.REDIS_VERBOSE_LOG) : false; +const REDIS_POOL_SIZE = process.env.REDIS_POOL_SIZE ? parseInt(process.env.REDIS_POOL_SIZE) : 15; class RedisStateStore { constructor(keyPrefix, opts) { @@ -24,7 +25,7 @@ class RedisStateStore { debug(`Overriding default, volatileKeyTTL=${opts.volatileKeyTTL}s`); this.volatileKeyTTL = opts.volatileKeyTTL; } - this.pool = this.createRedisPool(10, opts.redisUrl); + this.pool = this.createRedisPool(REDIS_POOL_SIZE, opts.redisUrl); } createRedisPool(size, redisUrl) {