Skip to content

Commit

Permalink
Catch TimeoutError
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinLi authored Oct 23, 2021
1 parent 54c2b88 commit 4e603c7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions my_project_name/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 4e603c7

Please sign in to comment.