From 4e603c799889c64a5175222a1094e91f4fba05b4 Mon Sep 17 00:00:00 2001 From: Kevin Li Date: Fri, 22 Oct 2021 22:49:30 -0400 Subject: [PATCH] Catch TimeoutError Fixes #26 --- my_project_name/main.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/my_project_name/main.py b/my_project_name/main.py index 9a83088..bec4362 100644 --- a/my_project_name/main.py +++ b/my_project_name/main.py @@ -125,6 +125,9 @@ def invite_event_filtered_callback( # Sleep so we don't bombard the server with login requests sleep(15) + except asyncio.TimeoutError: + logger.warning("Timed out while syncing with homeserver, retrying in 15s...") + sleep(15) finally: # Make sure to close the client connection on disconnect await client.close()