fix(emqx_recon): fix badarg for remote module load
This commit is contained in:
parent
7edb320ec8
commit
5477457c7e
|
@ -42,7 +42,7 @@ cmd(["node_stats"]) ->
|
||||||
recon:node_stats_print(10, 1000);
|
recon:node_stats_print(10, 1000);
|
||||||
|
|
||||||
cmd(["remote_load", Mod]) ->
|
cmd(["remote_load", Mod]) ->
|
||||||
emqx_ctl:print("~p~n", [recon:remote_load(list_to_atom(Mod))]);
|
emqx_ctl:print("~p~n", [remote_load(list_to_atom(Mod))]);
|
||||||
|
|
||||||
cmd(["proc_count", Attr, N]) ->
|
cmd(["proc_count", Attr, N]) ->
|
||||||
emqx_ctl:print("~p~n", [recon:proc_count(list_to_atom(Attr), list_to_integer(N))]);
|
emqx_ctl:print("~p~n", [recon:proc_count(list_to_atom(Attr), list_to_integer(N))]);
|
||||||
|
@ -61,3 +61,12 @@ unload() ->
|
||||||
concat(Key, Keyword) ->
|
concat(Key, Keyword) ->
|
||||||
lists:concat([atom_to_list(Key), "/", atom_to_list(Keyword)]).
|
lists:concat([atom_to_list(Key), "/", atom_to_list(Keyword)]).
|
||||||
|
|
||||||
|
remote_load(Module) -> remote_load(nodes(), Module).
|
||||||
|
|
||||||
|
%% recon:remote_load/1 has a bug, when nodes() returns [], it is
|
||||||
|
%% taken by recon as a node name.
|
||||||
|
%% before OTP 23, the call returns a 'badrpc' tuple
|
||||||
|
%% after OTP 23, it crashes with 'badarg' error
|
||||||
|
remote_load([], _Module) -> ok;
|
||||||
|
remote_load(Nodes, Module) -> recon:remote_load(Nodes, Module).
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue