From 882b543bcacfe3f42baadbcd778929b2c5ff08ec Mon Sep 17 00:00:00 2001 From: Ethan Dickson Date: Fri, 8 Nov 2024 09:14:56 +0000 Subject: [PATCH] chore: increase autostop requirement leeway to two hours --- coderd/schedule/autostop.go | 4 ++-- coderd/schedule/autostop_test.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/coderd/schedule/autostop.go b/coderd/schedule/autostop.go index 88529d26b3b78..f6a01633f3179 100644 --- a/coderd/schedule/autostop.go +++ b/coderd/schedule/autostop.go @@ -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 diff --git a/coderd/schedule/autostop_test.go b/coderd/schedule/autostop_test.go index e28ce3579cd4c..8b4fe969e59d7 100644 --- a/coderd/schedule/autostop_test.go +++ b/coderd/schedule/autostop_test.go @@ -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, pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy