Fixed flood error endless sleep

This commit is contained in:
Анатолий Богомолов 2024-02-08 17:59:17 +10:00
parent cd95928843
commit 8dce3b1f62
1 changed files with 2 additions and 7 deletions

View File

@ -35,15 +35,11 @@ class PaperParser:
except (UserPrivacyException, IgnoreException) as e: except (UserPrivacyException, IgnoreException) as e:
self.users_to_delete.append(user) self.users_to_delete.append(user)
logger.exception(e)
logger.warning("Exception occurred. Skipping user...") logger.warning("Exception occurred. Skipping user...")
except Exception as e:
logger.exception(e)
finally: finally:
if not task.is_aborted(): 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): async def send_messages(self, users, message: str, file: str | None = None, task = None):
# TODO: Filter users, that already get this message # TODO: Filter users, that already get this message
@ -61,12 +57,11 @@ class PaperParser:
except (UserPrivacyException, IgnoreException) as e: except (UserPrivacyException, IgnoreException) as e:
self.users_to_delete.append(user) self.users_to_delete.append(user)
logger.exception(e)
logger.warning("Exception occurred. Skipping user...") logger.warning("Exception occurred. Skipping user...")
finally: finally:
if not task.is_aborted(): 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): async def get_participants(self, group):
await self.client.invite_self(group) await self.client.invite_self(group)