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

Commit46f6f9c

Browse files
chore: remove deadline from running workspaces on ttl change
1 parent20c36a6 commit46f6f9c

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

‎coderd/workspaces.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,6 +1029,25 @@ func (api *API) putWorkspaceTTL(rw http.ResponseWriter, r *http.Request) {
10291029
returnxerrors.Errorf("update workspace time until shutdown: %w",err)
10301030
}
10311031

1032+
// If autostop has been disabled, we want to remove the deadline from the
1033+
// existing workspace build (if there is one).
1034+
if!dbTTL.Valid {
1035+
build,err:=s.GetLatestWorkspaceBuildByWorkspaceID(ctx,workspace.ID)
1036+
iferr!=nil {
1037+
returnxerrors.Errorf("get latest workspace build: %w",err)
1038+
}
1039+
1040+
ifbuild.Transition==database.WorkspaceTransitionStart {
1041+
iferr=s.UpdateWorkspaceBuildDeadlineByID(ctx, database.UpdateWorkspaceBuildDeadlineByIDParams{
1042+
ID:build.ID,
1043+
Deadline: time.Time{},
1044+
MaxDeadline:build.MaxDeadline,
1045+
});err!=nil {
1046+
returnxerrors.Errorf("update workspace build deadline: %w",err)
1047+
}
1048+
}
1049+
}
1050+
10321051
returnnil
10331052
},nil)
10341053
iferr!=nil {

‎site/src/pages/WorkspaceSettingsPage/WorkspaceSchedulePage/WorkspaceSchedulePage.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,10 @@ export const WorkspaceSchedulePage: FC = () => {
118118

119119
awaitsubmitScheduleMutation.mutateAsync(data);
120120

121-
if(data.autostopChanged){
121+
if(
122+
data.autostopChanged&&
123+
getAutostop(workspace).autostopEnabled
124+
){
122125
setIsConfirmingApply(true);
123126
}
124127
}}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp