Skip to content

Commit

Permalink
fix: no response after re-connect / while re-connecting
Browse files Browse the repository at this point in the history
Co-authored-by: eyMarv <eyMarv07@gmail.com>
  • Loading branch information
SpEcHiDe and eyMarv committed Jul 18, 2024
1 parent 00e7765 commit 961243f
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions pyrogram/session/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,9 +494,6 @@ async def invoke(
timeout: float = WAIT_TIMEOUT,
sleep_threshold: float = SLEEP_THRESHOLD
):
if self.instant_stop:
return # stop instantly

if isinstance(query, Session.CUR_ALWD_INNR_QRYS):
inner_query = query.query
else:
Expand All @@ -505,16 +502,16 @@ async def invoke(
query_name = ".".join(inner_query.QUALNAME.split(".")[1:])

while retries > 0:
if self.instant_stop:
return # stop instantly

# sleep until the restart is performed
if self.currently_restarting:
while self.currently_restarting:
if self.instant_stop:
return # stop instantly
await asyncio.sleep(1)

if self.instant_stop:
return # stop instantly

if not self.is_started.is_set():
await self.is_started.wait()

Expand Down

0 comments on commit 961243f

Please sign in to comment.