add sync timeout

this prevents us spamming the server with sync requests
master
lub 4 years ago
parent 63e878ae7d
commit 6e9823df5e

@ -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)

Loading…
Cancel
Save