Skip to content

Commit

Permalink
Always no-raise try-to-pop registry addrs
Browse files Browse the repository at this point in the history
  • Loading branch information
goodboy committed Sep 15, 2023
1 parent 687852f commit 3dc57e3
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions tractor/_runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -1879,8 +1879,16 @@ async def delete_sockaddr(
sockaddr: tuple[str, int],

) -> tuple[str, str]:
uid: tuple = self._registry.inverse.pop(sockaddr)
log.warning(
f'Deleting registry entry for {sockaddr}@{uid}!'
uid: tuple | None = self._registry.inverse.pop(
sockaddr,
None,
)
if uid:
log.warning(
f'Deleting registry entry for {sockaddr}@{uid}!'
)
else:
log.warning(
f'No registry entry for {sockaddr}@{uid}!'
)
return uid

0 comments on commit 3dc57e3

Please sign in to comment.