Skip to content

Commit 137dc6e

Browse files
fix: remove update to workspace TTL on template TTL change for AGPL (#15943)
1 parent 9e9a5fd commit 137dc6e

File tree

2 files changed

+0
-168
lines changed

2 files changed

+0
-168
lines changed

coderd/schedule/template.go

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package schedule
22

33
import (
44
"context"
5-
"database/sql"
65
"time"
76

87
"github.com/google/uuid"
@@ -229,23 +228,6 @@ func (*agplTemplateScheduleStore) Set(ctx context.Context, db database.Store, tp
229228
return xerrors.Errorf("update template schedule: %w", err)
230229
}
231230

232-
// Users running the AGPL version are unable to customize their workspaces
233-
// autostop, so we want to keep their workspaces in track with any template
234-
// TTL changes.
235-
if tpl.DefaultTTL != int64(opts.DefaultTTL) {
236-
var ttl sql.NullInt64
237-
if opts.DefaultTTL != 0 {
238-
ttl = sql.NullInt64{Valid: true, Int64: int64(opts.DefaultTTL)}
239-
}
240-
241-
if err = db.UpdateWorkspacesTTLByTemplateID(ctx, database.UpdateWorkspacesTTLByTemplateIDParams{
242-
TemplateID: tpl.ID,
243-
Ttl: ttl,
244-
}); err != nil {
245-
return xerrors.Errorf("update workspace ttl by template id %q: %w", tpl.ID, err)
246-
}
247-
}
248-
249231
template, err = db.GetTemplateByID(ctx, tpl.ID)
250232
if err != nil {
251233
return xerrors.Errorf("fetch updated template: %w", err)

coderd/schedule/template_test.go

Lines changed: 0 additions & 150 deletions
This file was deleted.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy