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

Commit2761b7e

Browse files
committed
refactor: remove template lifecycle update changes
1 parent04a481d commit2761b7e

File tree

3 files changed

+6
-29
lines changed

3 files changed

+6
-29
lines changed

‎coderd/database/queries.sql.go‎

Lines changed: 2 additions & 9 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎coderd/database/queries/workspaces.sql‎

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -567,11 +567,7 @@ UPDATE
567567
SET
568568
ttl= $2
569569
WHERE
570-
template_id= $1
571-
-- Prebuilt workspaces (identified by having the prebuilds system user as owner_id)
572-
-- should not have their TTL updated, as they are handled by the prebuilds
573-
-- reconciliation loop.
574-
ANDworkspaces.owner_id!='c42fdf75-3097-471c-8c33-fb52454d81c0'::UUID;
570+
template_id= $1;
575571

576572
-- name: UpdateWorkspaceLastUsedAt :exec
577573
UPDATE
@@ -821,11 +817,8 @@ SET
821817
dormant_at= CASE WHEN @dormant_at::timestamptz>'0001-01-01 00:00:00+00'::timestamptz THEN @dormant_at::timestamptz ELSE dormant_at END
822818
WHERE
823819
template_id= @template_id
824-
AND dormant_atIS NOT NULL
825-
-- Prebuilt workspaces (identified by having the prebuilds system user as owner_id)
826-
-- should not have their dormant or deleting at set, as these are handled by the
827-
-- prebuilds reconciliation loop.
828-
ANDworkspaces.owner_id!='c42fdf75-3097-471c-8c33-fb52454d81c0'::UUID
820+
AND
821+
dormant_atIS NOT NULL
829822
RETURNING*;
830823

831824
-- name: UpdateTemplateWorkspacesLastUsedAt :exec

‎enterprise/coderd/schedule/template.go‎

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -242,10 +242,6 @@ func (s *EnterpriseTemplateScheduleStore) Set(ctx context.Context, db database.S
242242
nextStartAts:= []time.Time{}
243243

244244
for_,workspace:=rangeworkspaces {
245-
// Skip prebuilt workspaces
246-
ifworkspace.IsPrebuild() {
247-
continue
248-
}
249245
nextStartAt:= time.Time{}
250246
ifworkspace.AutostartSchedule.Valid {
251247
next,err:=agpl.NextAllowedAutostart(s.now(),workspace.AutostartSchedule.String,templateSchedule)
@@ -258,7 +254,7 @@ func (s *EnterpriseTemplateScheduleStore) Set(ctx context.Context, db database.S
258254
nextStartAts=append(nextStartAts,nextStartAt)
259255
}
260256

261-
//nolint:gocritic // We need to be able to update information aboutregular workspaces.
257+
//nolint:gocritic // We need to be able to update information aboutall workspaces.
262258
iferr:=db.BatchUpdateWorkspaceNextStartAt(dbauthz.AsSystemRestricted(ctx), database.BatchUpdateWorkspaceNextStartAtParams{
263259
IDs:workspaceIDs,
264260
NextStartAts:nextStartAts,
@@ -338,11 +334,6 @@ func (s *EnterpriseTemplateScheduleStore) updateWorkspaceBuild(ctx context.Conte
338334
returnxerrors.Errorf("get workspace %q: %w",build.WorkspaceID,err)
339335
}
340336

341-
// Skip lifecycle updates for prebuilt workspaces
342-
ifworkspace.IsPrebuild() {
343-
returnnil
344-
}
345-
346337
job,err:=db.GetProvisionerJobByID(ctx,build.JobID)
347338
iferr!=nil {
348339
returnxerrors.Errorf("get provisioner job %q: %w",build.JobID,err)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp