Update suspended cleaning command (#10195)

closes https://github.com/twentyhq/core-team-issues/issues/382
This commit is contained in:
Etienne
2025-02-14 16:49:44 +01:00
committed by GitHub
parent 968ad3bd31
commit db526778e3
12 changed files with 256 additions and 106 deletions

View File

@ -877,13 +877,23 @@ export class EnvironmentVariables {
})
@CastToPositiveNumber()
@IsNumber()
@ValidateIf((env) => env.WORKSPACE_INACTIVE_DAYS_BEFORE_DELETION > 0)
@IsStrictlyLowerThan('WORKSPACE_INACTIVE_DAYS_BEFORE_SOFT_DELETION', {
message:
'"WORKSPACE_INACTIVE_DAYS_BEFORE_NOTIFICATION" should be strictly lower than "WORKSPACE_INACTIVE_DAYS_BEFORE_SOFT_DELETION"',
})
WORKSPACE_INACTIVE_DAYS_BEFORE_NOTIFICATION = 7;
@EnvironmentVariablesMetadata({
group: EnvironmentVariablesGroup.Other,
description: 'Number of inactive days before soft deleting workspaces',
})
@CastToPositiveNumber()
@IsNumber()
@IsStrictlyLowerThan('WORKSPACE_INACTIVE_DAYS_BEFORE_DELETION', {
message:
'"WORKSPACE_INACTIVE_DAYS_BEFORE_NOTIFICATION" should be strictly lower than "WORKSPACE_INACTIVE_DAYS_BEFORE_DELETION"',
'"WORKSPACE_INACTIVE_DAYS_BEFORE_SOFT_DELETION" should be strictly lower than "WORKSPACE_INACTIVE_DAYS_BEFORE_DELETION"',
})
@ValidateIf((env) => env.WORKSPACE_INACTIVE_DAYS_BEFORE_DELETION > 0)
WORKSPACE_INACTIVE_DAYS_BEFORE_NOTIFICATION = 7;
WORKSPACE_INACTIVE_DAYS_BEFORE_SOFT_DELETION = 14;
@EnvironmentVariablesMetadata({
group: EnvironmentVariablesGroup.Other,
@ -891,8 +901,7 @@ export class EnvironmentVariables {
})
@CastToPositiveNumber()
@IsNumber()
@ValidateIf((env) => env.WORKSPACE_INACTIVE_DAYS_BEFORE_NOTIFICATION > 0)
WORKSPACE_INACTIVE_DAYS_BEFORE_DELETION = 14;
WORKSPACE_INACTIVE_DAYS_BEFORE_DELETION = 21;
@EnvironmentVariablesMetadata({
group: EnvironmentVariablesGroup.Other,