Skip to content

Commit

Permalink
Fix code style issues with Black
Browse files Browse the repository at this point in the history
  • Loading branch information
lint-action committed Sep 30, 2024
1 parent bfa8f02 commit 3a0cac9
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/client_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,7 @@ async def polling(self) -> None:
except asyncio.CancelledError:
return
except UnauthorizedError as error:
client_handler_errors_metric.labels(
type=type(error).__name__
).inc()
client_handler_errors_metric.labels(type=type(error).__name__).inc()
log.info(f"session for {self.context.samoware_login} expired")
samoware_password = self.db.get_password(self.context.telegram_id)
if samoware_password is None:
Expand All @@ -166,19 +164,15 @@ async def polling(self) -> None:
log.warning(
f"retry_count={retry_count}. ClientOSError. Probably Broken pipe. Retrying in {HTTP_RETRY_DELAY_SEC} seconds. {str(error)}"
)
client_handler_errors_metric.labels(
type=type(error).__name__
).inc()
client_handler_errors_metric.labels(type=type(error).__name__).inc()
retry_count += 1
await asyncio.sleep(HTTP_RETRY_DELAY_SEC)
except Exception as error:
log.exception("exception in client_handler")
log.warning(
f"retry_count={retry_count}. Retrying longpolling for {self.context.samoware_login} in {HTTP_RETRY_DELAY_SEC} seconds..."
)
client_handler_errors_metric.labels(
type=type(error).__name__
).inc()
client_handler_errors_metric.labels(type=type(error).__name__).inc()
retry_count += 1
await asyncio.sleep(HTTP_RETRY_DELAY_SEC)
finally:
Expand Down

0 comments on commit 3a0cac9

Please sign in to comment.