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 b594cc1 commit b93a682
Showing 1 changed file with 6 additions and 18 deletions.
24 changes: 6 additions & 18 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 All @@ -201,9 +195,7 @@ async def login(self, samoware_password: str) -> bool:
return True
except UnauthorizedError as error:
log.info(f"unsuccessful login for user {self.context.samoware_login}")
client_handler_errors_metric.labels(
type=type(error).__name__
).inc()
client_handler_errors_metric.labels(type=type(error).__name__).inc()
return False
except asyncio.CancelledError:
log.info("login cancelled")
Expand All @@ -212,9 +204,7 @@ async def login(self, samoware_password: str) -> bool:
log.exception(
f"retry_count={retry_count}. exception on login. retrying in {HTTP_RETRY_DELAY_SEC}..."

Check failure on line 205 in src/client_handler.py

View check run for this annotation

GitHub Actions / Flake8

src/client_handler.py#L205

Continuation line over-indented for hanging indent (E126)
)
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)

Expand All @@ -238,9 +228,7 @@ async def revalidate(self) -> bool:
return True
except UnauthorizedError as error:
log.exception("UnauthorizedError on revalidation")
client_handler_errors_metric.labels(
type=type(error).__name__
).inc()
client_handler_errors_metric.labels(type=type(error).__name__).inc()
return False

async def can_not_revalidate(self):
Expand Down

0 comments on commit b93a682

Please sign in to comment.