Skip to content

Commit dc84fb8

Browse files
committed
Add comment
1 parent b8f88a7 commit dc84fb8

File tree

5 files changed

+19
-2
lines changed

5 files changed

+19
-2
lines changed

coderd/activitybump_internal_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package coderd
22

33
import (
4-
"context"
54
"database/sql"
65
"testing"
76
"time"

coderd/database/dbmem/dbmem.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -834,7 +834,7 @@ func (q *FakeQuerier) ActivityBumpWorkspace(ctx context.Context, arg database.Ac
834834
if now.Add(time.Hour).After(arg.NextAutostart) && arg.NextAutostart.After(now) {
835835
// Extend to TTL
836836
add := arg.NextAutostart.Sub(now)
837-
if workspace.Ttl.Valid {
837+
if workspace.Ttl.Valid && template.AllowUserAutostop {
838838
add += time.Duration(workspace.Ttl.Int64)
839839
} else {
840840
add += time.Duration(template.DefaultTTL)

coderd/database/querier.go

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/queries.sql.go

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/queries/activitybump.sql

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
-- Bumps the workspace deadline by 1 hour. If the workspace bump will
2+
-- cross an autostart threshold, then the bump is autostart + TTL. This
3+
-- is the deadline behavior if the workspace was to autostart from a stopped
4+
-- state.
5+
-- Max deadline is respected, and will never be bumped.
6+
-- The deadline will never decrease.
17
-- name: ActivityBumpWorkspace :exec
28
WITH latest AS (
39
SELECT

0 commit comments

Comments
 (0)