Skip to content

Commit 2064b97

Browse files
committed
build list uses API size limit
1 parent 830856d commit 2064b97

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

drone/build/build_list.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func buildList(c *cli.Context) error {
5858
return err
5959
}
6060

61-
builds, err := client.BuildList(owner, name, drone.ListOptions{Page: c.Int("page")})
61+
builds, err := client.BuildList(owner, name, drone.ListOptions{Page: c.Int("page"), Size: c.Int("limit")})
6262
if err != nil {
6363
return err
6464
}
@@ -71,13 +71,8 @@ func buildList(c *cli.Context) error {
7171
branch := c.String("branch")
7272
event := c.String("event")
7373
status := c.String("status")
74-
limit := c.Int("limit")
7574

76-
var count int
7775
for _, build := range builds {
78-
if count >= limit {
79-
break
80-
}
8176
if branch != "" && build.Target != branch {
8277
continue
8378
}
@@ -88,7 +83,6 @@ func buildList(c *cli.Context) error {
8883
continue
8984
}
9085
tmpl.Execute(os.Stdout, build)
91-
count++
9286
}
9387
return nil
9488
}

0 commit comments

Comments
 (0)