Invalidate legacy cache after flats (#17126)
# Introduction Some legacy caches are based on the flat ones So we need to seq invalidate before invalidating others as it could result in inter dep cache invalidation race condition
This commit is contained in:
+8
-7
@@ -180,18 +180,19 @@ export class WorkspaceMigrationRunnerService {
|
||||
`Cache invalidation ${flatEntitiesCacheToInvalidate.join()}`,
|
||||
);
|
||||
|
||||
const invalidationResults = await Promise.allSettled([
|
||||
this.flatEntityMapsCacheService.invalidateFlatEntityMaps({
|
||||
workspaceId,
|
||||
flatMapsKeys: flatEntitiesCacheToInvalidate,
|
||||
}),
|
||||
...this.getLegacyCacheInvalidationPromises({
|
||||
await this.flatEntityMapsCacheService.invalidateFlatEntityMaps({
|
||||
workspaceId,
|
||||
flatMapsKeys: flatEntitiesCacheToInvalidate,
|
||||
});
|
||||
|
||||
const invalidationResults = await Promise.allSettled(
|
||||
this.getLegacyCacheInvalidationPromises({
|
||||
workspaceMigration: {
|
||||
actions,
|
||||
workspaceId,
|
||||
},
|
||||
}),
|
||||
]);
|
||||
);
|
||||
|
||||
const invalidationFailures = invalidationResults.filter(
|
||||
(result) => result.status === 'rejected',
|
||||
|
||||
Reference in New Issue
Block a user