Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita5d1977

Browse files
chore: increase autostop requirement leeway to two hours (#15445)
Closes#12612The problem in the linked issue was caused due to a mismatch of when theWeb UI tooltip shows up (2 hours before an autostop requirement) and theleeway in the `autostop_requirement` algorithm (workspace builds must be1 hour before an autostop requirement to skip them).Now, restarting your workspace whilst the tooltip is showing will skipthe upcoming autostop requirement.This also could have been fixed by only showing the tooltip one hourbefore the autostop requirement, but it looks like 1 hour was chosenarbitrarily, and it doesn't hurt to give users more time to skip theautostop.
1 parent6cc1067 commita5d1977

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

‎coderd/schedule/autostop.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ const (
1717
// requirement where we skip the requirement and fall back to the next
1818
// scheduled stop. This avoids workspaces being stopped too soon.
1919
//
20-
// E.g. If the workspace is started withinan hour of the quiet hours, we
20+
// E.g. If the workspace is started withintwo hours of the quiet hours, we
2121
// will skip the autostop requirement and use the next scheduled
2222
// stop time instead.
23-
autostopRequirementLeeway=1*time.Hour
23+
autostopRequirementLeeway=2*time.Hour
2424

2525
// autostopRequirementBuffer is the duration of time we subtract from the
2626
// time when calculating the next scheduled stop time. This avoids issues

‎coderd/schedule/autostop_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,8 +292,8 @@ func TestCalculateAutoStop(t *testing.T) {
292292
name:"TimeBeforeEpoch",
293293
// The epoch is 2023-01-02 in each timezone. We set the time to
294294
// 1 second before 11pm the previous day, as this is the latest time
295-
// we allow due to our1h leeway logic.
296-
now:time.Date(2023,1,1,22,59,59,0,sydneyLoc),
295+
// we allow due to our2h leeway logic.
296+
now:time.Date(2023,1,1,21,59,59,0,sydneyLoc),
297297
templateAllowAutostop:true,
298298
templateDefaultTTL:0,
299299
userQuietHoursSchedule:sydneyQuietHours,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp