mirror of
https://github.com/coder/coder.git
synced 2025-07-03 16:13:58 +00:00
fix: fix failed workspaces continuously auto-deleting (#10069)
- Fixes an issue where workspaces that are eligible for auto-deletion are retried every tick (1 minute) even if the previous deletion transition failed. The updated logic only attempts to delete workspaces that previously failed once a day (24 hours since last attempt).
This commit is contained in:
@ -367,3 +367,19 @@ func ConvertWorkspaceRows(rows []GetWorkspacesRow) []Workspace {
|
||||
func (g Group) IsEveryone() bool {
|
||||
return g.ID == g.OrganizationID
|
||||
}
|
||||
|
||||
func (p ProvisionerJob) Finished() bool {
|
||||
return p.CanceledAt.Valid || p.CompletedAt.Valid
|
||||
}
|
||||
|
||||
func (p ProvisionerJob) FinishedAt() time.Time {
|
||||
if p.CompletedAt.Valid {
|
||||
return p.CompletedAt.Time
|
||||
}
|
||||
|
||||
if p.CanceledAt.Valid {
|
||||
return p.CanceledAt.Time
|
||||
}
|
||||
|
||||
return time.Time{}
|
||||
}
|
||||
|
Reference in New Issue
Block a user