Skip to content

Commit

Permalink
._root: set a _default_lo_addrs and apply it when not provided by c…
Browse files Browse the repository at this point in the history
…aller
  • Loading branch information
goodboy committed Oct 18, 2023
1 parent ca3f7a1 commit fcc8cee
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions tractor/_root.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,14 @@


# set at startup and after forks
_default_arbiter_host: str = '127.0.0.1'
_default_arbiter_port: int = 1616
_default_lo_host: str = '127.0.0.1'
_default_port: int = 1616

# default registry always on localhost
_default_lo_addrs: list[tuple[str, int]] = [(
_default_lo_host,
_default_port,
)]


logger = log.get_logger('tractor')
Expand Down Expand Up @@ -124,10 +130,8 @@ async def open_root_actor(

registry_addrs: list[tuple[str, int]] = (
registry_addrs
or [( # default on localhost
_default_arbiter_host,
_default_arbiter_port,
)]
or
_default_lo_addrs
)

loglevel = (loglevel or log._default_loglevel).upper()
Expand Down Expand Up @@ -329,9 +333,7 @@ def run_daemon(

# runtime kwargs
name: str | None = 'root',
registry_addrs: list[tuple[str, int]] = [
(_default_arbiter_host, _default_arbiter_port)
],
registry_addrs: list[tuple[str, int]] = _default_lo_addrs,

start_method: str | None = None,
debug_mode: bool = False,
Expand Down

0 comments on commit fcc8cee

Please sign in to comment.