Make zx_daemon:idle/0 safe to call in all cases.
This commit is contained in:
parent
ebc870d1ed
commit
93e5bdb9e6
@ -372,11 +372,15 @@ start() ->
|
||||
Error -> done(Error)
|
||||
end;
|
||||
["rundir", Path | _] ->
|
||||
{ok, #{package_id := PackageID}} = zx_lib:read_project_meta(Path),
|
||||
zx_lib:new_logpath(PackageID);
|
||||
case zx_lib:read_project_meta(Path) of
|
||||
{ok, #{package_id := PackageID}} -> zx_lib:new_logpath(PackageID);
|
||||
Error -> done(Error)
|
||||
end;
|
||||
["runlocal" | _] ->
|
||||
{ok, #{package_id := PackageID}} = zx_lib:read_project_meta(),
|
||||
zx_lib:new_logpath(PackageID);
|
||||
case zx_lib:read_project_meta() of
|
||||
{ok, #{package_id := PackageID}} -> zx_lib:new_logpath(PackageID);
|
||||
Error -> done(Error)
|
||||
end;
|
||||
_ ->
|
||||
{ok, Version} = zx_lib:string_to_version(os:getenv("ZX_VERSION")),
|
||||
zx_lib:new_logpath({"otpr", "zx", Version})
|
||||
|
||||
@ -790,7 +790,10 @@ conf(Attribute, Value) ->
|
||||
%%% (pre) Shutdown
|
||||
|
||||
idle() ->
|
||||
gen_server:call(?MODULE, idle).
|
||||
case whereis(?MODULE) of
|
||||
undefined -> ok;
|
||||
Daemon -> gen_server:call(Daemon, idle)
|
||||
end.
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user