-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update suspended cleaning command #10195
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This PR introduces a refined three-stage workspace cleanup process with improved handling of inactive workspaces.
- Added soft deletion phase between notification and permanent deletion in
.env.example
, with timeframes of 7 days (notification), 14 days (soft delete), and 21 days (permanent delete) - Modified
UserWorkspace
entity to use@DeleteDateColumn
for proper TypeORM soft delete functionality - Added
withDeleted: true
option in workspace queries to ensure processing of both active and soft-deleted suspended workspaces - Added
dryRun
parameter and improved error handling in cleaner service for safer testing and execution - Fixed critical logical error in
CleanSuspendedWorkspacesCommand
where incorrect variable is passed tobatchWarnOrCleanSuspendedWorkspaces
8 file(s) reviewed, 10 comment(s)
Edit PR Review Bot Settings | Greptile
packages/twenty-server/src/engine/core-modules/environment/environment-variables.ts
Outdated
Show resolved
Hide resolved
packages/twenty-server/src/engine/core-modules/environment/environment-variables.ts
Outdated
Show resolved
Hide resolved
packages/twenty-server/src/engine/core-modules/workspace/services/workspace.service.ts
Outdated
Show resolved
Hide resolved
packages/twenty-server/src/engine/core-modules/workspace/services/workspace.service.ts
Outdated
Show resolved
Hide resolved
packages/twenty-server/src/engine/core-modules/workspace/services/workspace.service.ts
Outdated
Show resolved
Hide resolved
packages/twenty-server/src/engine/core-modules/user-workspace/user-workspace.entity.ts
Show resolved
Hide resolved
...-server/src/engine/workspace-manager/workspace-cleaner/services/cleaner.workspace-service.ts
Outdated
Show resolved
Hide resolved
...-server/src/engine/workspace-manager/workspace-cleaner/services/cleaner.workspace-service.ts
Show resolved
Hide resolved
...rc/engine/workspace-manager/workspace-cleaner/commands/clean-suspended-workspaces.command.ts
Outdated
Show resolved
Hide resolved
packages/twenty-server/src/engine/core-modules/environment/environment-variables.ts
Show resolved
Hide resolved
packages/twenty-server/src/engine/core-modules/user-workspace/user-workspace.entity.ts
Show resolved
Hide resolved
packages/twenty-server/src/engine/metadata-modules/object-metadata/object-metadata.service.ts
Show resolved
Hide resolved
Thanks @etiennejouan for your contribution! |
closes twentyhq/core-team-issues#382