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

Commitc3aef93

Browse files
authored
feat: add locked TTL field to template meta (#8020)
1 parent1ecc371 commitc3aef93

File tree

27 files changed

+291
-90
lines changed

27 files changed

+291
-90
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/modelqueries.go‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func (q *sqlQuerier) GetAuthorizedTemplates(ctx context.Context, arg GetTemplate
5454
pq.Array(arg.IDs),
5555
)
5656
iferr!=nil {
57-
returnnil,err
57+
returnnil,xerrors.Errorf("query context: %w",err)
5858
}
5959
deferrows.Close()
6060
varitems []Template
@@ -82,16 +82,17 @@ func (q *sqlQuerier) GetAuthorizedTemplates(ctx context.Context, arg GetTemplate
8282
&i.AllowUserAutostop,
8383
&i.FailureTTL,
8484
&i.InactivityTTL,
85+
&i.LockedTTL,
8586
);err!=nil {
86-
returnnil,err
87+
returnnil,xerrors.Errorf("scan: %w",err)
8788
}
8889
items=append(items,i)
8990
}
9091
iferr:=rows.Close();err!=nil {
91-
returnnil,err
92+
returnnil,xerrors.Errorf("close: %w",err)
9293
}
9394
iferr:=rows.Err();err!=nil {
94-
returnnil,err
95+
returnnil,xerrors.Errorf("rowserr: %w",err)
9596
}
9697
returnitems,nil
9798
}

‎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
@@ -56,6 +56,7 @@ overrides:
5656
failure_ttl:FailureTTL
5757
inactivity_ttl:InactivityTTL
5858
eof:EOF
59+
locked_ttl:LockedTTL
5960

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp