[ENH] Do not fail on missed cache within server commands (#10634)

Avoid critical failure if cache is missed when interacting with the
twenty-orm in the upgrade commands
This commit is contained in:
Paul Rastoin
2025-03-04 10:28:21 +01:00
committed by GitHub
parent 156530ff5e
commit ad628c1266
2 changed files with 4 additions and 0 deletions

View File

@ -227,9 +227,11 @@ export class MigrateRichTextContentPatchCommand extends ActiveOrSuspendedWorkspa
const schemaName =
this.workspaceDataSourceService.getSchemaName(workspaceId);
const failOnMetadataCacheMiss = false;
const workspaceDataSource =
await this.twentyORMGlobalManager.getDataSourceForWorkspace(
workspaceId,
failOnMetadataCacheMiss,
);
const rows = await workspaceDataSource.query(

View File

@ -76,10 +76,12 @@ export class UpdateDefaultViewRecordOpeningOnWorkflowObjectsCommand extends Acti
workflowObjectMetadataIds: string[],
workspaceId: string,
): Promise<void> {
const failOnMetadataCacheMiss = false;
const viewRepository =
await this.twentyORMGlobalManager.getRepositoryForWorkspace(
workspaceId,
'view',
failOnMetadataCacheMiss,
);
await viewRepository.update(