From 8dce3b1f62f6a24fa1ec560cac88ad8eaade078b Mon Sep 17 00:00:00 2001 From: winet Date: Thu, 8 Feb 2024 17:59:17 +1000 Subject: [PATCH] Fixed flood error endless sleep --- paper/parser.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/paper/parser.py b/paper/parser.py index ef72bc3..e4261b0 100644 --- a/paper/parser.py +++ b/paper/parser.py @@ -35,15 +35,11 @@ class PaperParser: except (UserPrivacyException, IgnoreException) as e: self.users_to_delete.append(user) - logger.exception(e) logger.warning("Exception occurred. Skipping user...") - except Exception as e: - logger.exception(e) - finally: if not task.is_aborted(): - await asyncio.sleep(50) # FIXME: Change to config value + await asyncio.sleep(70) # FIXME: Change to config value async def send_messages(self, users, message: str, file: str | None = None, task = None): # TODO: Filter users, that already get this message @@ -61,12 +57,11 @@ class PaperParser: except (UserPrivacyException, IgnoreException) as e: self.users_to_delete.append(user) - logger.exception(e) logger.warning("Exception occurred. Skipping user...") finally: if not task.is_aborted(): - await asyncio.sleep(50) # FIXME: Change to config value + await asyncio.sleep(70) # FIXME: Change to config value async def get_participants(self, group): await self.client.invite_self(group)