From aa80c9b427e0568924e1e19d2f17e182812ce314 Mon Sep 17 00:00:00 2001 From: Thomas Camlong Date: Fri, 19 Jun 2026 22:28:56 +0200 Subject: [PATCH] fix(redis): skip integration cache invalidation without client --- packages/redis/src/lib/channel.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/redis/src/lib/channel.ts b/packages/redis/src/lib/channel.ts index 7d3b9bb88..3348ba84b 100644 --- a/packages/redis/src/lib/channel.ts +++ b/packages/redis/src/lib/channel.ts @@ -268,15 +268,20 @@ export const createIntegrationOptionsChannel = ( * updated integration is never served from cache. */ export const invalidateIntegrationCacheAsync = async (integrationId: string): Promise => { + const client = getSetClient as typeof getSetClient | null; + if (!client) { + return; + } + const patterns = [`integration:${integrationId}:*`, `session-store:${integrationId}`]; let deletedCount = 0; for (const pattern of patterns) { let cursor = "0"; do { - const [nextCursor, keys] = await getSetClient.scan(cursor, "MATCH", pattern, "COUNT", 200); + const [nextCursor, keys] = await client.scan(cursor, "MATCH", pattern, "COUNT", 200); cursor = nextCursor; if (keys.length > 0) { - await getSetClient.del(...keys); + await client.del(...keys); deletedCount += keys.length; } } while (cursor !== "0");