Skip to content

Commit

Permalink
Add envvar for adjusting redis pool size (#318)
Browse files Browse the repository at this point in the history
* chore: new envvar for redis pool size, default 30

* set default pool size to 15
  • Loading branch information
Nfrederiksen authored Nov 18, 2024
1 parent 24ad83c commit ca92fa7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion engine/redis_state_store.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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) {
Expand Down

0 comments on commit ca92fa7

Please sign in to comment.