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
This commit is contained in:
Weiko 2024-11-20 18:29:29 +01:00 committed by GitHub
parent 2968085e73
commit ffbc9ca59c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -34,6 +34,7 @@ export class WorkspaceCacheStorageService {
return this.cacheStorageService.set<EntitySchemaOptions<any>[]>( return this.cacheStorageService.set<EntitySchemaOptions<any>[]>(
`${WorkspaceCacheKeys.ORMEntitySchemas}:${workspaceId}:${metadataVersion}`, `${WorkspaceCacheKeys.ORMEntitySchemas}:${workspaceId}:${metadataVersion}`,
entitySchemas, entitySchemas,
TTL_INFINITE,
); );
} }
@ -70,6 +71,7 @@ export class WorkspaceCacheStorageService {
return this.cacheStorageService.set<boolean>( return this.cacheStorageService.set<boolean>(
`${WorkspaceCacheKeys.MetadataObjectMetadataOngoingCachingLock}:${workspaceId}:${metadataVersion}`, `${WorkspaceCacheKeys.MetadataObjectMetadataOngoingCachingLock}:${workspaceId}:${metadataVersion}`,
true, true,
TTL_INFINITE,
); );
} }
@ -99,6 +101,7 @@ export class WorkspaceCacheStorageService {
return this.cacheStorageService.set<ObjectMetadataMaps>( return this.cacheStorageService.set<ObjectMetadataMaps>(
`${WorkspaceCacheKeys.MetadataObjectMetadataMaps}:${workspaceId}:${metadataVersion}`, `${WorkspaceCacheKeys.MetadataObjectMetadataMaps}:${workspaceId}:${metadataVersion}`,
objectMetadataMaps, objectMetadataMaps,
TTL_INFINITE,
); );
} }
@ -119,6 +122,7 @@ export class WorkspaceCacheStorageService {
return this.cacheStorageService.set<string>( return this.cacheStorageService.set<string>(
`${WorkspaceCacheKeys.GraphQLTypeDefs}:${workspaceId}:${metadataVersion}`, `${WorkspaceCacheKeys.GraphQLTypeDefs}:${workspaceId}:${metadataVersion}`,
typeDefs, typeDefs,
TTL_INFINITE,
); );
} }
@ -139,6 +143,7 @@ export class WorkspaceCacheStorageService {
return this.cacheStorageService.set<string[]>( return this.cacheStorageService.set<string[]>(
`${WorkspaceCacheKeys.GraphQLUsedScalarNames}:${workspaceId}:${metadataVersion}`, `${WorkspaceCacheKeys.GraphQLUsedScalarNames}:${workspaceId}:${metadataVersion}`,
usedScalarNames, usedScalarNames,
TTL_INFINITE,
); );
} }