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

Commita546a85

Browse files
authored
fix(coderd): set default provisionerjobs limit to 50 (#16450)
1 parentb3b229c commita546a85

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

‎coderd/provisionerjobs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ func (api *API) handleAuthAndFetchProvisionerJobs(rw http.ResponseWriter, r *htt
101101

102102
qp:=r.URL.Query()
103103
p:=httpapi.NewQueryParamParser()
104-
limit:=p.PositiveInt32(qp,0,"limit")
104+
limit:=p.PositiveInt32(qp,50,"limit")
105105
status:=p.Strings(qp,nil,"status")
106106
p.ErrorExcessParams(qp)
107107
iflen(p.Errors)>0 {

‎coderd/provisionerjobs_test.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,13 @@ func TestProvisionerJobs(t *testing.T) {
6363
TemplateVersionID:version.ID,
6464
})
6565

66+
// Add more jobs than the default limit.
67+
forrange60 {
68+
dbgen.ProvisionerJob(t,db,nil, database.ProvisionerJob{
69+
OrganizationID:owner.OrganizationID,
70+
})
71+
}
72+
6673
t.Run("Single",func(t*testing.T) {
6774
t.Parallel()
6875
t.Run("OK",func(t*testing.T) {
@@ -82,12 +89,12 @@ func TestProvisionerJobs(t *testing.T) {
8289
})
8390
})
8491

85-
t.Run("All",func(t*testing.T) {
92+
t.Run("Default limit",func(t*testing.T) {
8693
t.Parallel()
8794
ctx:=testutil.Context(t,testutil.WaitMedium)
8895
jobs,err:=templateAdminClient.OrganizationProvisionerJobs(ctx,owner.OrganizationID,nil)
8996
require.NoError(t,err)
90-
require.Len(t,jobs,3)
97+
require.Len(t,jobs,50)
9198
})
9299

93100
t.Run("Status",func(t*testing.T) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp