Skip to content

Commit

Permalink
chore(kv): standardize createKvBufferStore to allow optional redis co…
Browse files Browse the repository at this point in the history
…nfigs and default them
  • Loading branch information
dtfiedler authored and djwhitt committed Sep 25, 2024
1 parent b97e682 commit a577ec5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/init/header-stores.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,16 @@ const createKvBufferStore = ({
pathKey,
type,
log,
redisUrl = config.REDIS_CACHE_URL,
redisTtlSeconds = config.REDIS_CACHE_TTL_SECONDS,
useTls = config.REDIS_USE_TLS,
}: {
pathKey: string;
type: string;
log: winston.Logger;
redisUrl?: string;
redisTtlSeconds?: number;
useTls?: boolean;
}): KVBufferStore => {
log.info(`Using ${type} for KVBufferStore for ${pathKey}`);
switch (type) {
Expand All @@ -48,9 +52,9 @@ const createKvBufferStore = ({
}
case 'redis': {
return new RedisKvStore({
redisUrl: config.REDIS_CACHE_URL,
redisUrl,
ttlSeconds: redisTtlSeconds,
useTls: config.REDIS_USE_TLS,
useTls,
log,
});
}
Expand Down

0 comments on commit a577ec5

Please sign in to comment.