We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9625637 commit 295b755Copy full SHA for 295b755
enterprise/coderd/schedule/template.go
@@ -277,6 +277,9 @@ func (s *EnterpriseTemplateScheduleStore) updateWorkspaceBuild(ctx context.Conte
277
}
278
279
// If max deadline is before now()+2h, then set it to that.
280
+ // This is intended to give ample warning to this workspace about an upcoming auto-stop.
281
+ // If we were to omit this "grace" period, then this workspace could be set to be stopped "now".
282
+ // The "2 hours" was an arbitrary decision for this window.
283
now := s.now()
284
if !autostop.MaxDeadline.IsZero() && autostop.MaxDeadline.Before(now.Add(2*time.Hour)) {
285
autostop.MaxDeadline = now.Add(time.Hour * 2)
0 commit comments