fix(cache): pass useRedisSets option to KeyvRedis cache storage adapter

Co-authored-by: Patrik Oldsberg <poldsberg@gmail.com>
Signed-off-by: zcmander <zcmander@gmail.com>
This commit is contained in:
zcmander
2024-09-13 14:57:05 +03:00
committed by Teijo Mursu
parent 303461cd96
commit 213664e85b
2 changed files with 8 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/backend-defaults': patch
---
Fixed an issue where the `useRedisSets` configuration for the cache service would have no effect.
@@ -147,7 +147,9 @@ export class CacheManager {
let store: typeof KeyvRedis | undefined;
return (pluginId, defaultTtl) => {
if (!store) {
store = new KeyvRedis(this.connection);
store = new KeyvRedis(this.connection, {
useRedisSets: this.useRedisSets,
});
// Always provide an error handler to avoid stopping the process
store.on('error', (err: Error) => {
this.logger?.error('Failed to create redis cache client', err);