Skip to content

Commit

Permalink
fix: Calculate now in batch exports (#26527)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasfarias authored Nov 28, 2024
1 parent 81a2d9c commit 3ab5e4e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions posthog/temporal/batch_exports/batch_exports.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))

0 comments on commit 3ab5e4e

Please sign in to comment.