Remove 'matter of taste' comment and max()

the amount of extra mental overhead this introduces is not offset by the
gain in correctness
This commit is contained in:
Klaas van Schelven
2026-01-07 11:40:40 +01:00
parent 1d261b4b7c
commit 802768f63d

View File

@@ -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