From ffbc9ca59cd1440a4a2ff2e6b81e1726b81cb9e6 Mon Sep 17 00:00:00 2001 From: Weiko Date: Wed, 20 Nov 2024 18:29:29 +0100 Subject: [PATCH] Set infinite ttl to all workspace cache keys (#8616) ## Context We recently added an infinite ttl to metadata version however other keys such as the object metadata map are also linked to the version so keeping the version in cache without the rest breaks the app. I'm editing all engine related keys with infinite ttl --- .../workspace-cache-storage.service.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/twenty-server/src/engine/workspace-cache-storage/workspace-cache-storage.service.ts b/packages/twenty-server/src/engine/workspace-cache-storage/workspace-cache-storage.service.ts index dabb3b4676..6c4ddf9767 100644 --- a/packages/twenty-server/src/engine/workspace-cache-storage/workspace-cache-storage.service.ts +++ b/packages/twenty-server/src/engine/workspace-cache-storage/workspace-cache-storage.service.ts @@ -34,6 +34,7 @@ export class WorkspaceCacheStorageService { return this.cacheStorageService.set[]>( `${WorkspaceCacheKeys.ORMEntitySchemas}:${workspaceId}:${metadataVersion}`, entitySchemas, + TTL_INFINITE, ); } @@ -70,6 +71,7 @@ export class WorkspaceCacheStorageService { return this.cacheStorageService.set( `${WorkspaceCacheKeys.MetadataObjectMetadataOngoingCachingLock}:${workspaceId}:${metadataVersion}`, true, + TTL_INFINITE, ); } @@ -99,6 +101,7 @@ export class WorkspaceCacheStorageService { return this.cacheStorageService.set( `${WorkspaceCacheKeys.MetadataObjectMetadataMaps}:${workspaceId}:${metadataVersion}`, objectMetadataMaps, + TTL_INFINITE, ); } @@ -119,6 +122,7 @@ export class WorkspaceCacheStorageService { return this.cacheStorageService.set( `${WorkspaceCacheKeys.GraphQLTypeDefs}:${workspaceId}:${metadataVersion}`, typeDefs, + TTL_INFINITE, ); } @@ -139,6 +143,7 @@ export class WorkspaceCacheStorageService { return this.cacheStorageService.set( `${WorkspaceCacheKeys.GraphQLUsedScalarNames}:${workspaceId}:${metadataVersion}`, usedScalarNames, + TTL_INFINITE, ); }