From 802768f63dd2c7bdd58ab3fee8bbe0868d0db4d0 Mon Sep 17 00:00:00 2001 From: Klaas van Schelven Date: Wed, 7 Jan 2026 11:40:40 +0100 Subject: [PATCH] Remove 'matter of taste' comment and max() the amount of extra mental overhead this introduces is not offset by the gain in correctness --- ingest/views.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ingest/views.py b/ingest/views.py index 27bd9bd..e214663 100644 --- a/ingest/views.py +++ b/ingest/views.py @@ -547,10 +547,7 @@ class BaseIngestAPIView(View): until = max([below_from for (is_exceeded, below_from, _, _) in states if is_exceeded], default=None) - # "at least 1" is a matter of taste; because the actual usage of `next_quota_check` is with a gte, leaving - # it out would result in the same behavior. But once we reach this point we know that digested_event_count - # will increase, so we know that a next check cannot happen before current + 1, we might as well be explicit - check_again_after = max(1, min([check_after for (_, _, check_after, _) in states], default=1)) + check_again_after = min([check_after for (_, _, check_after, _) in states], default=1) project.quota_exceeded_until = until