Gitlab Community Edition Instance

Commit 463e64fe authored by mhellka's avatar mhellka
Browse files

Be nice and limit search results per page to a reasonable number.

parent 953321a3
......@@ -35,18 +35,22 @@ def search(ctx, args):
found = 0
page = None
while limit > found:
page =, query, limit=limit - found, order=order, scroll=scroll)
page =, query, limit=min(1024, limit - found), order=order, scroll=scroll)
if not page.hits:
break # no more results
for hit in page.hits[:limit - found] if page.hits else []:
for hit in page.hits or []:
found += 1
if hit.type == 'archive':
elif hit.type == 'file':
if found >= limit:
if args.no_scroll:
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment