Skip to content

Commit

Permalink
black code format
Browse files Browse the repository at this point in the history
Signed-off-by: eyMarv <[email protected]>
  • Loading branch information
eyMarv committed Aug 28, 2024
1 parent 81bd73d commit 0258a54
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
5 changes: 4 additions & 1 deletion pyrogram/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,10 @@ async def handle_updates(self, updates):
except ChannelPrivate:
pass
except PersistentTimestampInvalid:
log.warning("[pyroblack] Client [%s] got PERSISTENT_TIMESTAMP_INVALID.", self.name)
log.warning(
"[pyroblack] Client [%s] got PERSISTENT_TIMESTAMP_INVALID.",
self.name,
)
else:
if not isinstance(
diff, raw.types.updates.ChannelDifferenceEmpty
Expand Down
9 changes: 7 additions & 2 deletions pyrogram/dispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,13 @@ async def start(self):
)
except (errors.ChannelPrivate, errors.ChannelInvalid):
break
except errors.exceptions.bad_request_400.PersistentTimestampInvalid:
log.warning("[pyroblack]-recover-updates- Client [%s] got PERSISTENT_TIMESTAMP_INVALID.", self.client.name)
except (
errors.exceptions.bad_request_400.PersistentTimestampInvalid
):
log.warning(
"[pyroblack]-recover-updates- Client [%s] got PERSISTENT_TIMESTAMP_INVALID.",
self.client.name,
)
break
if isinstance(diff, raw.types.updates.DifferenceEmpty):
break
Expand Down
6 changes: 5 additions & 1 deletion pyrogram/session/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,11 @@ async def invoke(
return # stop instantly

if not self.is_started.is_set():
if self.currently_restarting or self.currently_stopping or self.currently_starting:
if (
self.currently_restarting
or self.currently_stopping
or self.currently_starting
):
await self.is_started.wait()
else: # need to start
await self.start()
Expand Down

0 comments on commit 0258a54

Please sign in to comment.