move deletion limit on hard deletion (#10353)
This commit is contained in:
@ -278,7 +278,8 @@ export class CleanerWorkspaceService {
|
|||||||
|
|
||||||
if (
|
if (
|
||||||
daysSinceSoftDeleted >
|
daysSinceSoftDeleted >
|
||||||
this.inactiveDaysBeforeDelete - this.inactiveDaysBeforeSoftDelete
|
this.inactiveDaysBeforeDelete - this.inactiveDaysBeforeSoftDelete &&
|
||||||
|
deletedWorkspacesCount < this.maxNumberOfWorkspacesDeletedPerExecution
|
||||||
) {
|
) {
|
||||||
this.logger.log(
|
this.logger.log(
|
||||||
`${dryRun ? 'DRY RUN - ' : ''}Destroying workspace ${workspace.id} ${workspace.displayName}`,
|
`${dryRun ? 'DRY RUN - ' : ''}Destroying workspace ${workspace.id} ${workspace.displayName}`,
|
||||||
@ -286,20 +287,16 @@ export class CleanerWorkspaceService {
|
|||||||
if (!dryRun) {
|
if (!dryRun) {
|
||||||
await this.workspaceService.deleteWorkspace(workspace.id);
|
await this.workspaceService.deleteWorkspace(workspace.id);
|
||||||
}
|
}
|
||||||
|
deletedWorkspacesCount++;
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (
|
if (workspaceInactivity > this.inactiveDaysBeforeSoftDelete) {
|
||||||
workspaceInactivity > this.inactiveDaysBeforeSoftDelete &&
|
|
||||||
deletedWorkspacesCount <=
|
|
||||||
this.maxNumberOfWorkspacesDeletedPerExecution
|
|
||||||
) {
|
|
||||||
await this.informWorkspaceMembersAndSoftDeleteWorkspace(
|
await this.informWorkspaceMembersAndSoftDeleteWorkspace(
|
||||||
workspace,
|
workspace,
|
||||||
workspaceInactivity,
|
workspaceInactivity,
|
||||||
dryRun,
|
dryRun,
|
||||||
);
|
);
|
||||||
deletedWorkspacesCount++;
|
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user