Add fail on metadata cache miss (#7118)

- avoid failing when missing cache (used for command)
- remove unused load cache function. Cache will be always re-created
when trying to fetch if not existing
This commit is contained in:
Thomas Trompette
2024-09-18 15:40:24 +02:00
committed by GitHub
parent 44587b4908
commit 741a969cc1
5 changed files with 92 additions and 74 deletions

View File

@ -47,9 +47,9 @@ export class WorkspaceSchemaFactory {
);
if (currentCacheVersion === undefined) {
await this.workspaceMetadataCacheService.recomputeMetadataCache(
authContext.workspace.id,
);
await this.workspaceMetadataCacheService.recomputeMetadataCache({
workspaceId: authContext.workspace.id,
});
throw new GraphqlQueryRunnerException(
'Metadata cache version not found',
GraphqlQueryRunnerExceptionCode.METADATA_CACHE_VERSION_NOT_FOUND,
@ -63,9 +63,9 @@ export class WorkspaceSchemaFactory {
);
if (!objectMetadataMap) {
await this.workspaceMetadataCacheService.recomputeMetadataCache(
authContext.workspace.id,
);
await this.workspaceMetadataCacheService.recomputeMetadataCache({
workspaceId: authContext.workspace.id,
});
throw new GraphqlQueryRunnerException(
'Object metadata collection not found',
GraphqlQueryRunnerExceptionCode.METADATA_CACHE_VERSION_NOT_FOUND,