From 76ceb2f2b9e653f18fdc373726e12747f1536d4f Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Fri, 22 Dec 2023 14:07:47 +0000 Subject: [PATCH] Only paginate queries by integer values In order to avoid a bug where overlap page calculations could result in requesting a fractional offset, coerce the value to an integer. Change-Id: I22f9b444bf0965bf3146f3238a2afdf6d9860248 --- engagement/stats.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engagement/stats.py b/engagement/stats.py index 6fe8c4b..f4361f6 100755 --- a/engagement/stats.py +++ b/engagement/stats.py @@ -384,7 +384,7 @@ def main(verbose=0): # Offset additional pages by half the returned entry count to help # avoid missing changes due to pagination instability if new_changes and new_changes[-1].get('_more_changes', False): - offset += len(new_changes)/2 + offset += int(len(new_changes)/2) else: offset = -1