From: Luke Kenneth Casson Leighton Date: Tue, 20 Apr 2021 09:51:24 +0000 (+0100) Subject: less than total requested can be returned. stop when amount is zero X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f703a2f020a1384e6fbf8b48f494588c92dbe74f;p=utils.git less than total requested can be returned. stop when amount is zero --- diff --git a/src/budget_sync/util.py b/src/budget_sync/util.py index 20e7da6..342f685 100644 --- a/src/budget_sync/util.py +++ b/src/budget_sync/util.py @@ -37,6 +37,7 @@ def all_bugs(bz: Bugzilla) -> Iterator[Bug]: while True: bugs = bz.getbugs(list(range(chunk_start, chunk_start + chunk_size))) chunk_start += chunk_size - yield from bugs - if len(bugs) < chunk_size: + print ("bugs loaded", len(bugs), chunk_start) + if len(bugs) == 0: return + yield from bugs