From 912169657a3db8fce0c090c47ef7bc2f84c55667 Mon Sep 17 00:00:00 2001 From: Panoramic Date: Mon, 29 Jul 2024 12:55:44 +0300 Subject: [PATCH] Run timers after init sync --- vetting_bot/main.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/vetting_bot/main.py b/vetting_bot/main.py index 4d63053..018d4c5 100644 --- a/vetting_bot/main.py +++ b/vetting_bot/main.py @@ -113,13 +113,13 @@ async def main(): timer = Timer(client, store, config) - async def start_timer_with_delay(): - await asyncio.sleep(5) - await timer.start_all_timers() + logger.debug("Doing init sync") + await client.sync(timeout=0, full_state=True) - asyncio.create_task(start_timer_with_delay()) + await timer.start_all_timers() - await client.sync_forever(timeout=30000, full_state=True) + logger.debug("Continuing with sync_forever") + await client.sync_forever(timeout=30000, full_state=False) except (ClientConnectionError, ServerDisconnectedError): logger.warning("Unable to connect to homeserver, retrying in 15s...")