less than total requested can be returned. stop when amount is zero
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Tue, 20 Apr 2021 09:51:24 +0000 (10:51 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Tue, 20 Apr 2021 09:51:24 +0000 (10:51 +0100)
src/budget_sync/util.py

index 20e7da690b5ab2ea10ffee7c895929c14365b61b..342f685e9ed4f822cfcadc5424f6c05be6f98844 100644 (file)
@@ -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