fix(exhook): correct the exhook server anme
This commit is contained in:
parent
373532f9e4
commit
6710a508df
|
@ -36,6 +36,7 @@
|
||||||
%% Mgmt APIs
|
%% Mgmt APIs
|
||||||
%%--------------------------------------------------------------------
|
%%--------------------------------------------------------------------
|
||||||
|
|
||||||
|
%% XXX: Only return the running servers
|
||||||
-spec list() -> [emqx_exhook_server:server()].
|
-spec list() -> [emqx_exhook_server:server()].
|
||||||
list() ->
|
list() ->
|
||||||
[server(Name) || Name <- running()].
|
[server(Name) || Name <- running()].
|
||||||
|
|
|
@ -83,7 +83,7 @@
|
||||||
|
|
||||||
-spec load(atom(), list()) -> {ok, server()} | {error, term()} .
|
-spec load(atom(), list()) -> {ok, server()} | {error, term()} .
|
||||||
load(Name0, Opts0) ->
|
load(Name0, Opts0) ->
|
||||||
Name = prefix(Name0),
|
Name = to_list(Name0),
|
||||||
{SvrAddr, ClientOpts} = channel_opts(Opts0),
|
{SvrAddr, ClientOpts} = channel_opts(Opts0),
|
||||||
case emqx_exhook_sup:start_grpc_client_channel(
|
case emqx_exhook_sup:start_grpc_client_channel(
|
||||||
Name,
|
Name,
|
||||||
|
@ -110,12 +110,12 @@ load(Name0, Opts0) ->
|
||||||
end.
|
end.
|
||||||
|
|
||||||
%% @private
|
%% @private
|
||||||
prefix(Name) when is_atom(Name) ->
|
to_list(Name) when is_atom(Name) ->
|
||||||
"exhook:" ++ atom_to_list(Name);
|
atom_to_list(Name);
|
||||||
prefix(Name) when is_binary(Name) ->
|
to_list(Name) when is_binary(Name) ->
|
||||||
"exhook:" ++ binary_to_list(Name);
|
binary_to_list(Name);
|
||||||
prefix(Name) when is_list(Name) ->
|
to_list(Name) when is_list(Name) ->
|
||||||
"exhook:" ++ Name.
|
Name.
|
||||||
|
|
||||||
%% @private
|
%% @private
|
||||||
channel_opts(Opts) ->
|
channel_opts(Opts) ->
|
||||||
|
|
Loading…
Reference in New Issue