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

Commitedc7f15

Browse files
committed
feat: add locked TTL field to template meta
1 parent977e9ef commitedc7f15

File tree

19 files changed

+163
-85
lines changed

19 files changed

+163
-85
lines changed

‎coderd/apidoc/docs.go‎

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

‎coderd/apidoc/swagger.json‎

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

‎coderd/database/dump.sql‎

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
BEGIN;
2+
ALTERTABLE templates DROP COLUMN locked_ttl;
3+
COMMIT;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
BEGIN;
2+
ALTERTABLE templates ADD COLUMN locked_ttlBIGINTNOT NULL DEFAULT0;
3+
COMMIT;

‎coderd/database/models.go‎

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

‎coderd/database/queries.sql.go‎

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

‎coderd/database/queries/templates.sql‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@ SET
120120
default_ttl= $5,
121121
max_ttl= $6,
122122
failure_ttl= $7,
123-
inactivity_ttl= $8
123+
inactivity_ttl= $8,
124+
locked_ttl= $9
124125
WHERE
125126
id= $1
126127
RETURNING

‎coderd/database/sqlc.yaml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ overrides:
5555
uuid:UUID
5656
failure_ttl:FailureTTL
5757
inactivity_ttl:InactivityTTL
58+
locked_ttl:LockedTTL
5859

5960
sql:
6061
-schema:"./dump.sql"

‎coderd/schedule/template.go‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@ type TemplateScheduleOptions struct {
1818
//
1919
// If set, users cannot disable automatic workspace shutdown.
2020
MaxTTL time.Duration`json:"max_ttl"`
21-
//IfFailureTTLis set, allfailed workspaces will be stopped automatically after this time has elapsed.
21+
// FailureTTLdictates the duration after whichfailed workspaces will be stopped automatically.
2222
FailureTTL time.Duration`json:"failure_ttl"`
23-
//IfInactivityTTLis set, allinactive workspaces will bedeleted automatically after this time has elapsed.
23+
// InactivityTTLdictates the duration after whichinactive workspaces will belocked.
2424
InactivityTTL time.Duration`json:"inactivity_ttl"`
25+
// LockedTTL dictates the duration after which locked workspaces will be permanently deleted.
26+
LockedTTL time.Duration`json:"locked_ttl"`
2527
}
2628

2729
// TemplateScheduleStore provides an interface for retrieving template
@@ -51,11 +53,12 @@ func (*agplTemplateScheduleStore) GetTemplateScheduleOptions(ctx context.Context
5153
UserAutostartEnabled:true,
5254
UserAutostopEnabled:true,
5355
DefaultTTL:time.Duration(tpl.DefaultTTL),
54-
// Disregard the values in the database, since MaxTTL, FailureTTL, andInactivityTTL are enterprise
56+
// Disregard the values in the database, since MaxTTL, FailureTTL,InactivityTTL,andLockedTTL are enterprise
5557
// features.
5658
MaxTTL:0,
5759
FailureTTL:0,
5860
InactivityTTL:0,
61+
LockedTTL:0,
5962
},nil
6063
}
6164

@@ -76,5 +79,6 @@ func (*agplTemplateScheduleStore) SetTemplateScheduleOptions(ctx context.Context
7679
MaxTTL:tpl.MaxTTL,
7780
FailureTTL:tpl.FailureTTL,
7881
InactivityTTL:tpl.InactivityTTL,
82+
LockedTTL:tpl.LockedTTL,
7983
})
8084
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp