-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
feat: add clean suspended workspaces command #9808
feat: add clean suspended workspaces command #9808
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 new automated system for managing suspended workspaces through a daily cron job that runs at 10 PM UTC.
- Added
CleanSuspendedWorkspacesJob
in/workspace-cleaner/crons/clean-suspended-workspaces.job.ts
to handle workspace cleanup based on billing inactivity - Reduced workspace inactivity thresholds in
environment-variables.ts
from 30/60 days to 12/14 days for notification/deletion respectively - Added start/stop cron commands in
/workspace-cleaner/commands/
for managing the suspended workspace cleanup job - Added
BillingSubscription
tojobs.module.ts
for tracking workspace billing status - TODO placeholders for email notifications to workspace members before deletion (issues Add rule to order css in styled components alphabetically #284, 282 on opportunities page data pipeline + companies + people is fetched from be #285)
7 file(s) reviewed, 4 comment(s)
Edit PR Review Bot Settings | Greptile
...orkspace-manager/workspace-cleaner/commands/stop-clean-suspended-workspaces.cron.commands.ts
Outdated
Show resolved
Hide resolved
...rkspace-manager/workspace-cleaner/commands/start-clean-suspended-workspaces.cron.commands.ts
Outdated
Show resolved
Hide resolved
...ges/twenty-server/src/engine/workspace-manager/workspace-cleaner/workspace-cleaner.module.ts
Outdated
Show resolved
Hide resolved
...erver/src/engine/workspace-manager/workspace-cleaner/crons/clean-suspended-workspaces.job.ts
Show resolved
Hide resolved
...orkspace-manager/workspace-cleaner/commands/start-clean-suspended-workspaces.cron.command.ts
Outdated
Show resolved
Hide resolved
...erver/src/engine/workspace-manager/workspace-cleaner/crons/clean-suspended-workspaces.job.ts
Outdated
Show resolved
Hide resolved
...erver/src/engine/workspace-manager/workspace-cleaner/crons/clean-suspended-workspaces.job.ts
Show resolved
Hide resolved
...erver/src/engine/workspace-manager/workspace-cleaner/crons/clean-suspended-workspaces.job.ts
Outdated
Show resolved
Hide resolved
packages/twenty-server/src/engine/core-modules/environment/environment-variables.ts
Outdated
Show resolved
Hide resolved
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.
Very nice! I've left comments!
...erver/src/engine/workspace-manager/workspace-cleaner/crons/clean-suspended-workspaces.job.ts
Outdated
Show resolved
Hide resolved
@charlesBochet |
...enty-server/src/engine/core-modules/billing/services/billing-webhook-subscription.service.ts
Outdated
Show resolved
Hide resolved
e700817
to
42bf775
Compare
Log
|
closes [283 sub-issue](twentyhq/core-team-issues#283) - [parent issue ](https://github.com/orgs/twentyhq/projects/1/views/3?filterQuery=sprint%3A%40current+assignee%3Aetiennejouan&pane=issue&itemId=93520456&issue=twentyhq%7Ccore-team-issues%7C179) --------- Co-authored-by: etiennejouan <[email protected]>
closes 283 sub-issue - parent issue