[BUGFIX] Call and await destroyDataSourceForWorkspace to avoid killing poor pod (#10364)
# Motivations Upgrade migration is not possible atm in production because running over all workspaces cause cpu raise leading to pod termination
This commit is contained in:
@ -125,7 +125,9 @@ export class AddContextToActorCompositeTypeCommand extends ActiveWorkspacesComma
|
||||
);
|
||||
}
|
||||
|
||||
this.twentyORMGlobalManager.destroyDataSourceForWorkspace(workspaceId);
|
||||
await this.twentyORMGlobalManager.destroyDataSourceForWorkspace(
|
||||
workspaceId,
|
||||
);
|
||||
}
|
||||
|
||||
private async addContextColumn(
|
||||
|
||||
@ -91,6 +91,8 @@ export class RemoveDuplicateMcmasCommand extends ActiveWorkspacesCommandRunner {
|
||||
}
|
||||
}
|
||||
|
||||
this.twentyORMGlobalManager.destroyDataSourceForWorkspace(workspaceId);
|
||||
await this.twentyORMGlobalManager.destroyDataSourceForWorkspace(
|
||||
workspaceId,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -78,7 +78,9 @@ export class SeedWorkflowViewsCommand extends ActiveWorkspacesCommandRunner {
|
||||
dryRun,
|
||||
);
|
||||
|
||||
this.twentyORMGlobalManager.destroyDataSourceForWorkspace(workspaceId);
|
||||
await this.twentyORMGlobalManager.destroyDataSourceForWorkspace(
|
||||
workspaceId,
|
||||
);
|
||||
}
|
||||
|
||||
private async seedWorkflowViews(
|
||||
|
||||
@ -185,5 +185,9 @@ export class FixBodyV2ViewFieldPositionCommand extends ActiveWorkspacesCommandRu
|
||||
} catch (error) {
|
||||
this.logger.log(chalk.red(`Error in workspace ${workspaceId}`));
|
||||
}
|
||||
|
||||
await this.twentyORMGlobalManager.destroyDataSourceForWorkspace(
|
||||
workspaceId,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -87,6 +87,10 @@ export class LimitAmountOfViewFieldCommand extends ActiveWorkspacesCommandRunner
|
||||
error,
|
||||
);
|
||||
throw error;
|
||||
} finally {
|
||||
await this.twentyORMGlobalManager.destroyDataSourceForWorkspace(
|
||||
workspaceId,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -109,6 +109,8 @@ export class StandardizationOfActorCompositeContextTypeCommand extends ActiveWor
|
||||
);
|
||||
}
|
||||
|
||||
this.twentyORMGlobalManager.destroyDataSourceForWorkspace(workspaceId);
|
||||
await this.twentyORMGlobalManager.destroyDataSourceForWorkspace(
|
||||
workspaceId,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user