From 0ef940e0650650406918f93536aad3849c2508e4 Mon Sep 17 00:00:00 2001 From: blank X Date: Wed, 10 Mar 2021 15:43:49 +0700 Subject: [PATCH] Fix log_ring_worker --- sukuinote/__main__.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/sukuinote/__main__.py b/sukuinote/__main__.py index 9e54c9a..b192f95 100644 --- a/sukuinote/__main__.py +++ b/sukuinote/__main__.py @@ -22,13 +22,14 @@ async def main(): text = log_ring.popleft() except IndexError: pass - while True: - try: - await slave.send_message(config['config']['log_chat'], text, disable_web_page_preview=True) - except FloodWait as ex: - await asyncio.sleep(ex.x + 1) - else: - break + else: + while True: + try: + await slave.send_message(config['config']['log_chat'], text, disable_web_page_preview=True) + except FloodWait as ex: + await asyncio.sleep(ex.x + 1) + else: + break asyncio.create_task(log_ring_worker()) await asyncio.gather(*(_start_app(app) for app in apps), slave.start()) await idle()