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() ->
|
get_sys_memory() ->
|
||||||
case os:type() of
|
case os:type() of
|
||||||
{unix, linux} ->
|
{unix, linux} ->
|
||||||
emqx_mgmt_sys_memory:get_sys_memory();
|
emqx_mgmt_cache:get_sys_memory();
|
||||||
_ ->
|
_ ->
|
||||||
{0, 0}
|
{0, 0}
|
||||||
end.
|
end.
|
||||||
|
|
|
@ -26,8 +26,14 @@ start_link() ->
|
||||||
supervisor:start_link({local, ?MODULE}, ?MODULE, []).
|
supervisor:start_link({local, ?MODULE}, ?MODULE, []).
|
||||||
|
|
||||||
init([]) ->
|
init([]) ->
|
||||||
LC = child_spec(emqx_mgmt_cache, 5000, worker),
|
Workers =
|
||||||
{ok, {{one_for_one, 1, 5}, [LC]}}.
|
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) ->
|
child_spec(Mod, Shutdown, Type) ->
|
||||||
#{
|
#{
|
||||||
|
|
Loading…
Reference in New Issue