Skip to content

Commit ea2cb93

Browse files
committed
limit search result to 500 builds
1 parent 0c7ba1e commit ea2cb93

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

src/api/handlers/build.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ def get(self, project_id):
5353
if not build_from:
5454
build_from = max(build_to - 10, 0)
5555

56+
if build_to - build_from > 500:
57+
build_from = build_to - 500
58+
5659
p = g.db.execute_many_dict('''
5760
SELECT b.id, b.build_number, b.restart_counter, b.is_cronjob
5861
FROM build b

src/api/handlers/projects/jobs.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ def get(self, project_id):
6161
if not build_from:
6262
build_from = max(build_to - 10, 0)
6363

64+
if build_to - build_from > 500:
65+
build_from = build_to - 500
66+
6467
jobs = g.db.execute_many_dict('''
6568
SELECT
6669
-- build

0 commit comments

Comments
 (0)