From ddf7e724fdf6d1cc08ff8bc3e42459eb3c598020 Mon Sep 17 00:00:00 2001 From: miruka Date: Fri, 15 May 2020 16:37:37 -0400 Subject: [PATCH] Set a loop_sleep_time for sync_forever() https://github.com/poljar/matrix-nio/pull/132#pullrequestreview-412701098 "If not [set] the client will sync without any sleep between syncs. This will cause a lot of load on the homeserver and the client." --- src/backend/matrix_client.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/backend/matrix_client.py b/src/backend/matrix_client.py index a879f52c..abd10b78 100644 --- a/src/backend/matrix_client.py +++ b/src/backend/matrix_client.py @@ -333,6 +333,7 @@ class MatrixClient(nio.AsyncClient): try: self.sync_task = asyncio.ensure_future(self.sync_forever( timeout = 10_000, + loop_sleep_time = 1000, sync_filter = self.lazy_load_filter, first_sync_filter = filter1, ))