- Notifications
You must be signed in to change notification settings - Fork1.1k
feat: implement expiration policy logic for prebuilds#17996
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes from1 commit
a38ee7ca904d3fb0abd30f43ea2cc7e442c28a62747482bfb04c0e7c8e5caae4b1fbb530771cf266c44514be03f7a24eea7666090File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
…cy.ttl
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -81,14 +81,14 @@ func (s GlobalSnapshot) FilterByPreset(presetID uuid.UUID) (*PresetSnapshot, err | ||
| } | ||
| // filterExpiredWorkspaces splits running workspaces into expired and non-expired | ||
| // based on the preset's TTL. | ||
| //If TTL is missing or zero,all workspaces are considered non-expired. | ||
| func filterExpiredWorkspaces(preset database.GetTemplatePresetsWithPrebuildsRow, runningWorkspaces []database.GetRunningPrebuiltWorkspacesRow) (nonExpired []database.GetRunningPrebuiltWorkspacesRow, expired []database.GetRunningPrebuiltWorkspacesRow) { | ||
ContributorAuthor
| ||
| if !preset.Ttl.Valid { | ||
| return runningWorkspaces, expired | ||
| } | ||
| ttl := time.Duration(preset.Ttl.Int32) * time.Second | ||
| if ttl <= 0 { | ||
| return runningWorkspaces, expired | ||
| } | ||
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.