From ccd80abc5a9563540e24c20b997d6071926f4dd9 Mon Sep 17 00:00:00 2001 From: Shrimadhav U K Date: Wed, 1 Jan 2025 10:34:00 +0530 Subject: [PATCH] Update Pyrogram to v2.2.2 (#130) Try to fix #123 by sleeping for more time in invoke function --- pyrogram/__init__.py | 2 +- pyrogram/session/session.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pyrogram/__init__.py b/pyrogram/__init__.py index daadea636..5cb16b45f 100644 --- a/pyrogram/__init__.py +++ b/pyrogram/__init__.py @@ -17,7 +17,7 @@ # along with Pyrogram. If not, see . __fork_name__ = "pyrotgfork" -__version__ = "2.2.1" +__version__ = "2.2.2" __license__ = "GNU Lesser General Public License v3.0 (LGPL-3.0)" __copyright__ = "Copyright (C) 2017-present Dan " diff --git a/pyrogram/session/session.py b/pyrogram/session/session.py index 036d6a7a8..5df270bda 100644 --- a/pyrogram/session/session.py +++ b/pyrogram/session/session.py @@ -396,6 +396,8 @@ async def invoke( timeout: float = WAIT_TIMEOUT, sleep_threshold: float = SLEEP_THRESHOLD ): + sleep_threshold = max(sleep_threshold, self.client.sleep_threshold) + try: await asyncio.wait_for(self.is_connected.wait(), self.WAIT_TIMEOUT) except asyncio.TimeoutError: