Skip to content

Commit 54f6f84

Browse files
chore: update dbmem.go
1 parent 86ac8cf commit 54f6f84

File tree

12 files changed

+30
-1
lines changed

12 files changed

+30
-1
lines changed

cli/testdata/coder_list_--output_json.golden

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
},
6666
"automatic_updates": "never",
6767
"allow_renames": false,
68-
"favorite": false
68+
"favorite": false,
69+
"next_start_at": null
6970
}
7071
]

coderd/apidoc/docs.go

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

coderd/apidoc/swagger.json

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

coderd/database/dbmem/dbmem.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9801,6 +9801,7 @@ func (q *FakeQuerier) UpdateWorkspaceAutostart(_ context.Context, arg database.U
98019801
continue
98029802
}
98039803
workspace.AutostartSchedule = arg.AutostartSchedule
9804+
workspace.NextStartAt = arg.NextStartAt
98049805
q.workspaces[index] = workspace
98059806
return nil
98069807
}

coderd/database/queries.sql.go

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

coderd/database/queries/workspaces.sql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,10 @@ WHERE
619619
workspace_builds.transition = 'stop'::workspace_transition AND
620620
workspaces.autostart_schedule IS NOT NULL AND
621621
(
622+
-- next_start_at might be null when a coder instance has been updated
623+
-- and we haven't yet had an opportunity to set next_start_at. When
624+
-- this happens we leave it up to the Coder server to figure out if
625+
-- the workspace is ready to autostart.
622626
workspaces.next_start_at IS NULL OR
623627
workspaces.next_start_at <= @now :: timestamp
624628
)

codersdk/workspaces.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ type Workspace struct {
6363
AutomaticUpdates AutomaticUpdates `json:"automatic_updates" enums:"always,never"`
6464
AllowRenames bool `json:"allow_renames"`
6565
Favorite bool `json:"favorite"`
66+
NextStartAt *time.Time `json:"next_start_at" format:"date-time"`
6667
}
6768

6869
func (w Workspace) FullName() string {

docs/reference/api/schemas.md

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

docs/reference/api/workspaces.md

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

site/src/api/typesGenerated.ts

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

0 commit comments

Comments
 (0)