Skip to content

Commit

Permalink
Add logs
Browse files Browse the repository at this point in the history
  • Loading branch information
RB387 committed Sep 23, 2024
1 parent 971a343 commit eb0ea44
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/magic_di/healthcheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,6 @@ async def ping(self, dependency: PingableProtocol) -> None:
dependency_name = dependency.__class__.__name__
self.injector.logger.debug("Pinging dependency %s...", dependency_name)

try:
await dependency.__ping__()
except Exception as exc:
self.injector.logger.exception("Failed to ping dependency %s", dependency_name)
raise exc # noqa: TRY201
else:
self.injector.logger.debug("Dependency %s is healthy", dependency_name)
await dependency.__ping__()

self.injector.logger.debug("Dependency %s is healthy", dependency_name)

0 comments on commit eb0ea44

Please sign in to comment.