Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
qinxuye committed Nov 25, 2024
1 parent 902f2e0 commit 659c704
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions python/xoscar/backends/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,20 @@ def _listen_client(self, client: Client):
async def get_client_via_type(
self, router: Router, dest_address: str, client_type: Type[Client]
) -> Client:
client = await router.get_client_via_type(
dest_address, client_type, from_who=self
)
try:
client = await router.get_client_via_type(
dest_address, client_type, from_who=self
)
except ConnectionError:
raise ServerClosed(f"Remote server {dest_address} closed")
self._listen_client(client)
return client

async def get_client(self, router: Router, dest_address: str) -> Client:
client = await router.get_client(dest_address, from_who=self)
try:
client = await router.get_client(dest_address, from_who=self)
except ConnectionError:
raise ServerClosed(f"Remote server {dest_address} closed")
self._listen_client(client)
return client

Expand Down

0 comments on commit 659c704

Please sign in to comment.