Use pre-set reg addrs in `maybe_spawn_daemon()`
Pull actor-runtime `registry_addrs` from (the new)
`tractor.get_runtime_vars()` (over the previous hardcoding of
`('127.0.0.1', 6116)`..)) so that underlying `find_service()` and
`maybe_open_pikerd()` calls use the local actor's assigned registrar
endpoints.
Note, this is particularly necessary to get the `pytest` harness workin
again alongside any local running `pikerd` instance(s).
(this commit msg was generated in some part by [`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-code
repair_tests
parent
bf43036fe1
commit
94ac2ee82a
|
|
@ -79,10 +79,17 @@ async def maybe_spawn_daemon(
|
||||||
lock = Services.locks[service_name]
|
lock = Services.locks[service_name]
|
||||||
await lock.acquire()
|
await lock.acquire()
|
||||||
|
|
||||||
|
if not pikerd_kwargs:
|
||||||
|
# XXX NOTE, pin to apprope `tractor` branch!
|
||||||
|
rtvs: dict = tractor.get_runtime_vars()
|
||||||
|
registry_addrs: list[tuple] = list(
|
||||||
|
map(tuple, rtvs['_registry_addrs'])
|
||||||
|
)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
async with find_service(
|
async with find_service(
|
||||||
service_name,
|
service_name,
|
||||||
registry_addrs=[('127.0.0.1', 6116)],
|
registry_addrs=registry_addrs,
|
||||||
) as portal:
|
) as portal:
|
||||||
if portal is not None:
|
if portal is not None:
|
||||||
lock.release()
|
lock.release()
|
||||||
|
|
@ -99,6 +106,7 @@ async def maybe_spawn_daemon(
|
||||||
# process tree
|
# process tree
|
||||||
async with maybe_open_pikerd(
|
async with maybe_open_pikerd(
|
||||||
loglevel=loglevel,
|
loglevel=loglevel,
|
||||||
|
registry_addrs=registry_addrs,
|
||||||
**pikerd_kwargs,
|
**pikerd_kwargs,
|
||||||
|
|
||||||
) as pikerd_portal:
|
) as pikerd_portal:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue