Skip to content

Commit

Permalink
Set cache metadata version to infinite TTL (twentyhq#8507)
Browse files Browse the repository at this point in the history
## 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">
  • Loading branch information
Weiko authored Nov 14, 2024
1 parent 5384b4a commit cfe3515
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ export enum WorkspaceCacheKeys {
MetadataVersion = 'metadata:workspace-metadata-version',
}

const TTL_INFINITE = 0;

@Injectable()
export class WorkspaceCacheStorageService {
constructor(
Expand Down Expand Up @@ -51,6 +53,7 @@ export class WorkspaceCacheStorageService {
return this.cacheStorageService.set<number>(
`${WorkspaceCacheKeys.MetadataVersion}:${workspaceId}`,
metadataVersion,
TTL_INFINITE,
);
}

Expand Down

0 comments on commit cfe3515

Please sign in to comment.