fix: only cache sys_memory in linux
This commit is contained in:
parent
71f00f2962
commit
56b9238645
|
@ -150,7 +150,7 @@ node_info() ->
|
|||
get_sys_memory() ->
|
||||
case os:type() of
|
||||
{unix, linux} ->
|
||||
emqx_mgmt_sys_memory:get_sys_memory();
|
||||
emqx_mgmt_cache:get_sys_memory();
|
||||
_ ->
|
||||
{0, 0}
|
||||
end.
|
||||
|
|
|
@ -26,8 +26,14 @@ start_link() ->
|
|||
supervisor:start_link({local, ?MODULE}, ?MODULE, []).
|
||||
|
||||
init([]) ->
|
||||
LC = child_spec(emqx_mgmt_cache, 5000, worker),
|
||||
{ok, {{one_for_one, 1, 5}, [LC]}}.
|
||||
Workers =
|
||||
case os:type() of
|
||||
{unix, linux} ->
|
||||
[child_spec(emqx_mgmt_cache, 5000, worker)];
|
||||
_ ->
|
||||
[]
|
||||
end,
|
||||
{ok, {{one_for_one, 1, 5}, Workers}}.
|
||||
|
||||
child_spec(Mod, Shutdown, Type) ->
|
||||
#{
|
||||
|
|
Loading…
Reference in New Issue