forked from goodboy/tractor
Test with `any(portals)` since `gather_contexts()` will return `list[None | tuple]`
parent
d651f3d8e9
commit
227c9ea173
|
@ -211,10 +211,14 @@ async def find_actor(
|
||||||
# 'Gathered portals:\n'
|
# 'Gathered portals:\n'
|
||||||
# f'{portals}'
|
# f'{portals}'
|
||||||
# )
|
# )
|
||||||
if not portals:
|
# NOTE: `gather_contexts()` will return a
|
||||||
|
# `tuple[None, None, ..., None]` if no contact
|
||||||
|
# can be made with any regstrar at any of the
|
||||||
|
# N provided addrs!
|
||||||
|
if not any(portals):
|
||||||
if raise_on_none:
|
if raise_on_none:
|
||||||
raise RuntimeError(
|
raise RuntimeError(
|
||||||
f'No {name} found registered @ {registry_addrs}'
|
f'No actor "{name}" found registered @ {registry_addrs}'
|
||||||
)
|
)
|
||||||
yield None
|
yield None
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue