Clean soft deleted suspended workspace command and ignore-grace-period flag (#17144)

# Introduction

In the https://github.com/twentyhq/core-team-issues/issues/1989 's
context we will apply migration through an upgrade command post entity
backfill to fit the applied constraint. But suspended soft deleted
workspace are not included in the upgrade workspace batches

In order to be able to pass the constraint in production, discussed with
@FelixMalfait, we will manually clear all the currently suspended and
soft deleted workspace ignore their grace period

## Force mode
When running the command in force it will ignore the limit per execution
( which really serve the cron job ) and the grace period

## Test
Tested on a production extract
This commit is contained in:
Paul Rastoin
2026-01-14 15:15:15 +01:00
committed by GitHub
parent 2c24180b44
commit 9e4247c934
11 changed files with 204 additions and 95 deletions
@@ -199,6 +199,12 @@ export class WorkspaceMigrationRunnerService {
);
if (invalidationFailures.length > 0) {
invalidationFailures.forEach((err) =>
this.logger.error(
`Failed to invalidate a legacy cache ${err.reason}`,
'Runner',
),
);
throw new Error(
`Failed to invalidate ${invalidationFailures.length} cache operations`,
);