Set cache metadata version to infinite TTL (#8507)

## Context
To avoid having a corrupt metadata version, we want to remove TTL for
that key.

## Test
<img width="592" alt="Screenshot 2024-11-15 at 00 02 05"
src="https://github.com/user-attachments/assets/9da0ae33-26a8-4e7b-82d0-dd691135a08f">
This commit is contained in:
Weiko 2024-11-15 00:05:42 +01:00 committed by GitHub
parent 5384b4aba5
commit cfe3515aa6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -17,6 +17,8 @@ export enum WorkspaceCacheKeys {
MetadataVersion = 'metadata:workspace-metadata-version', MetadataVersion = 'metadata:workspace-metadata-version',
} }
const TTL_INFINITE = 0;
@Injectable() @Injectable()
export class WorkspaceCacheStorageService { export class WorkspaceCacheStorageService {
constructor( constructor(
@ -51,6 +53,7 @@ export class WorkspaceCacheStorageService {
return this.cacheStorageService.set<number>( return this.cacheStorageService.set<number>(
`${WorkspaceCacheKeys.MetadataVersion}:${workspaceId}`, `${WorkspaceCacheKeys.MetadataVersion}:${workspaceId}`,
metadataVersion, metadataVersion,
TTL_INFINITE,
); );
} }