Skip to content

chore: increase autostop requirement leeway to two hours #15445

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

Merged
merged 1 commit into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions coderd/schedule/autostop.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ const (
// requirement where we skip the requirement and fall back to the next
// scheduled stop. This avoids workspaces being stopped too soon.
//
// E.g. If the workspace is started within an hour of the quiet hours, we
// E.g. If the workspace is started within two hours of the quiet hours, we
// will skip the autostop requirement and use the next scheduled
// stop time instead.
autostopRequirementLeeway = 1 * time.Hour
autostopRequirementLeeway = 2 * time.Hour

// autostopRequirementBuffer is the duration of time we subtract from the
// time when calculating the next scheduled stop time. This avoids issues
Expand Down
4 changes: 2 additions & 2 deletions coderd/schedule/autostop_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,8 @@ func TestCalculateAutoStop(t *testing.T) {
name: "TimeBeforeEpoch",
// The epoch is 2023-01-02 in each timezone. We set the time to
// 1 second before 11pm the previous day, as this is the latest time
// we allow due to our 1h leeway logic.
now: time.Date(2023, 1, 1, 22, 59, 59, 0, sydneyLoc),
// we allow due to our 2h leeway logic.
now: time.Date(2023, 1, 1, 21, 59, 59, 0, sydneyLoc),
templateAllowAutostop: true,
templateDefaultTTL: 0,
userQuietHoursSchedule: sydneyQuietHours,
Expand Down
Loading