From 3ab5e4ecb19bb9db107c828d33420278f82615f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Far=C3=ADas=20Santana?= Date: Fri, 29 Nov 2024 00:10:19 +0100 Subject: [PATCH] fix: Calculate now in batch exports (#26527) --- posthog/temporal/batch_exports/batch_exports.py | 1 + 1 file changed, 1 insertion(+) diff --git a/posthog/temporal/batch_exports/batch_exports.py b/posthog/temporal/batch_exports/batch_exports.py index 41568feeb501c..f8b4d34adc7ca 100644 --- a/posthog/temporal/batch_exports/batch_exports.py +++ b/posthog/temporal/batch_exports/batch_exports.py @@ -1166,6 +1166,7 @@ async def wait_for_delta_past_data_interval_end( now = dt.datetime.now(dt.UTC) while target + delta > now: + now = dt.datetime.now(dt.UTC) remaining = (target + delta) - now # Sleep between 1-10 seconds, there shouldn't ever be the need to wait too long. await asyncio.sleep(min(max(remaining.total_seconds(), 1), 10))