mirror of
https://github.com/coder/coder.git
synced 2025-07-23 21:32:07 +00:00
chore: cover deadline crossing autostart border on start (#13115)
When starting a workspace, if the deadline crosses an autostart boundary, the deadline is set to autostart + TTL. This copies the behavior in `ActivityBumpWorkspace`, but does not require activity.
This commit is contained in:
@ -263,8 +263,9 @@ func (s *EnterpriseTemplateScheduleStore) updateWorkspaceBuild(ctx context.Conte
|
||||
TemplateScheduleStore: s,
|
||||
UserQuietHoursScheduleStore: *s.UserQuietHoursScheduleStore.Load(),
|
||||
// Use the job completion time as the time we calculate autostop from.
|
||||
Now: job.CompletedAt.Time,
|
||||
Workspace: workspace,
|
||||
Now: job.CompletedAt.Time,
|
||||
Workspace: workspace,
|
||||
WorkspaceAutostart: workspace.AutostartSchedule.String,
|
||||
})
|
||||
if err != nil {
|
||||
return xerrors.Errorf("calculate new autostop for workspace %q: %w", workspace.ID, err)
|
||||
|
Reference in New Issue
Block a user