Fix metadata cache flush (#11646)
Attempt to fix https://twenty-v7.sentry.io/issues/6545999328/?environment=prod&project=4507072499810304&query=is%3Aunresolved%20issue.priority%3A%5Bhigh%2C%20medium%5D&referrer=issue-stream&sort=date&stream_index=2
This commit is contained in:
@ -55,7 +55,10 @@ export class WorkspaceMetadataCacheService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (currentCacheVersion !== undefined) {
|
if (currentCacheVersion !== undefined) {
|
||||||
this.workspaceCacheStorageService.flush(workspaceId, currentCacheVersion);
|
this.workspaceCacheStorageService.flushVersionedMetadata(
|
||||||
|
workspaceId,
|
||||||
|
currentCacheVersion,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
await this.workspaceCacheStorageService.addObjectMetadataCollectionOngoingCachingLock(
|
await this.workspaceCacheStorageService.addObjectMetadataCollectionOngoingCachingLock(
|
||||||
|
|||||||
@ -253,7 +253,10 @@ export class WorkspaceCacheStorageService {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
async flush(workspaceId: string, metadataVersion: number): Promise<void> {
|
async flushVersionedMetadata(
|
||||||
|
workspaceId: string,
|
||||||
|
metadataVersion: number,
|
||||||
|
): Promise<void> {
|
||||||
await this.cacheStorageService.del(
|
await this.cacheStorageService.del(
|
||||||
`${WorkspaceCacheKeys.MetadataObjectMetadataMaps}:${workspaceId}:${metadataVersion}`,
|
`${WorkspaceCacheKeys.MetadataObjectMetadataMaps}:${workspaceId}:${metadataVersion}`,
|
||||||
);
|
);
|
||||||
@ -272,6 +275,10 @@ export class WorkspaceCacheStorageService {
|
|||||||
await this.cacheStorageService.del(
|
await this.cacheStorageService.del(
|
||||||
`${WorkspaceCacheKeys.MetadataObjectMetadataOngoingCachingLock}:${workspaceId}:${metadataVersion}`,
|
`${WorkspaceCacheKeys.MetadataObjectMetadataOngoingCachingLock}:${workspaceId}:${metadataVersion}`,
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
async flush(workspaceId: string, metadataVersion: number): Promise<void> {
|
||||||
|
await this.flushVersionedMetadata(workspaceId, metadataVersion);
|
||||||
|
|
||||||
await this.cacheStorageService.del(
|
await this.cacheStorageService.del(
|
||||||
`${WorkspaceCacheKeys.MetadataPermissionsRolesPermissions}:${workspaceId}`,
|
`${WorkspaceCacheKeys.MetadataPermissionsRolesPermissions}:${workspaceId}`,
|
||||||
|
|||||||
Reference in New Issue
Block a user