From 6e9823df5ec8e44ea2e6ea87b69accd5d543a1b3 Mon Sep 17 00:00:00 2001 From: lub Date: Sun, 10 May 2020 11:55:51 +0200 Subject: [PATCH] add sync timeout this prevents us spamming the server with sync requests --- scrape.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scrape.py b/scrape.py index 09e84fb..8b35244 100644 --- a/scrape.py +++ b/scrape.py @@ -118,7 +118,8 @@ async def main(): while True: # do sync first to e.g. accept an admin room invite - sync = await matrix.sync(sync_filter=sync_filter) + sync = await matrix.sync(timeout=30000, sync_filter=sync_filter) + print('last sync: '+datetime.now()) for room_id in sync.rooms.invite: print('joining '+room_id) await matrix.join(room_id)