Skip to content

Commit 8d64840

Browse files
authored
Check update for every 5 minutes (temp) (#169)
1 parent 92ee59f commit 8d64840

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

config/appconf/appconf.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,11 @@ func SelfUpdateEnabled() bool {
8181
}
8282

8383
// UpdateCheckInterval returns the interval between update checks.
84-
// Controlled by HOSTLINK_UPDATE_CHECK_INTERVAL (default: 1h, clamped to [1m, 24h]).
84+
// Controlled by HOSTLINK_UPDATE_CHECK_INTERVAL (default: 5m, clamped to [1m, 24h]).
8585
func UpdateCheckInterval() time.Duration {
8686
const (
87-
defaultInterval = 1 * time.Hour
87+
// TODO(SLFHOST-11): revert to 1*time.Hour once self-update debugging is complete
88+
defaultInterval = 5 * time.Minute
8889
minInterval = 1 * time.Minute
8990
maxInterval = 24 * time.Hour
9091
)

config/appconf/appconf_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ func TestSelfUpdateEnabled_InvalidFallsToDefault(t *testing.T) {
2727
assert.True(t, SelfUpdateEnabled())
2828
}
2929

30-
func TestUpdateCheckInterval_Default1h(t *testing.T) {
30+
func TestUpdateCheckInterval_Default5m(t *testing.T) {
3131
t.Setenv("HOSTLINK_UPDATE_CHECK_INTERVAL", "")
32-
assert.Equal(t, 1*time.Hour, UpdateCheckInterval())
32+
assert.Equal(t, 5*time.Minute, UpdateCheckInterval())
3333
}
3434

3535
func TestUpdateCheckInterval_CustomValue(t *testing.T) {
@@ -49,7 +49,7 @@ func TestUpdateCheckInterval_ClampedToMax(t *testing.T) {
4949

5050
func TestUpdateCheckInterval_InvalidFallsToDefault(t *testing.T) {
5151
t.Setenv("HOSTLINK_UPDATE_CHECK_INTERVAL", "garbage")
52-
assert.Equal(t, 1*time.Hour, UpdateCheckInterval())
52+
assert.Equal(t, 5*time.Minute, UpdateCheckInterval())
5353
}
5454

5555
func TestUpdateLockTimeout_Default5m(t *testing.T) {

0 commit comments

Comments
 (0)