Skip to content

Commit

Permalink
Update Pyrogram to v2.1.33.10
Browse files Browse the repository at this point in the history
  • Loading branch information
SpEcHiDe committed Oct 13, 2024
1 parent 52b3f09 commit 9362ace
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pyrogram/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.

__fork_name__ = "pyrotgfork"
__version__ = "2.1.33.9"
__version__ = "2.1.33.10"
__license__ = "GNU Lesser General Public License v3.0 (LGPL-3.0)"
__copyright__ = "Copyright (C) 2017-present Dan <https://github.com/delivrance>"

Expand Down
6 changes: 0 additions & 6 deletions pyrogram/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,15 +338,9 @@ def __init__(
else:
self.storage = FileStorage(self.name, self.WORKDIR)

self.connection_factory = Connection
self.protocol_factory = TCPFull

self.dispatcher = Dispatcher(self)

self.rnd_id = MsgId

self.parser = Parser(self)

self.session = None

self.media_sessions = {}
Expand Down
13 changes: 11 additions & 2 deletions pyrogram/session/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,6 @@ async def handle_packet(self, packet):
"Most likely the client time has to be synchronized.")
except SecurityCheckMismatch as e:
log.info("Discarding packet: %s", e)
await self.connection.close()
return
else:
bisect.insort(self.stored_msg_ids, msg.msg_id)
Expand Down Expand Up @@ -423,7 +422,17 @@ async def invoke(

await asyncio.sleep(amount)
except (OSError, TimeoutError, InternalServerError, ServiceUnavailable) as e:
if retries == 0:
if (
retries == 0 or
(
isinstance(e, InternalServerError) and
e.code == 500 and
(e.ID or e.NAME) in [
"HISTORY_GET_FAILED",
"PERSISTENT_TIMESTAMP_OUTDATED",
]
)
):
raise e from None

(log.warning if retries < 2 else log.info)(
Expand Down

0 comments on commit 9362ace

Please sign in to comment.