From fa5da653a19c49bf4a589ded3d3e47bdd0b5fbc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Ja=C5=A1ek?= Date: Tue, 14 Jan 2025 16:40:07 +0100 Subject: [PATCH] fix elastic error when fetching expired events (#2180) fix `Result window is too large, from + size must be less than or equal to: [10000]` --- server/planning/events/events.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/planning/events/events.py b/server/planning/events/events.py index 57e24f13e..4c6bec981 100644 --- a/server/planning/events/events.py +++ b/server/planning/events/events.py @@ -790,7 +790,7 @@ def get_expired_items(self, expiry_datetime, spiked_events_only=False): total_received = 0 total_events = -1 - while True: + while total_received + get_max_recurrent_events() < 10000: # 10k is max elastic limit query["from"] = total_received results = self.search(query)