Merge pull request #26672 from zcmander/zcmander/fix-keyvredis-useredissets-opt

fix(cache): pass useRedisSets option to KeyvRedis cache storage adapter
This commit is contained in:
Patrik Oldsberg
2024-09-14 19:26:15 +02:00
committed by GitHub
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);