This commit is contained in:
安礼成 2023-03-28 15:19:49 +08:00
parent 67b03e26fc
commit dfc3fa5132
4 changed files with 5 additions and 5 deletions

View File

@ -13,7 +13,7 @@
parse_trans,
hackney,
poolboy,
emqtt,
mnesia,
crypto,
public_key,

View File

@ -35,7 +35,7 @@ get_name(HostId) when is_binary(HostId) ->
-spec(start_link(Name :: atom(), Host :: #host{}) ->
{ok, Pid :: pid()} | ignore | {error, Reason :: term()}).
start_link(Name, Host = #host{}) ->
gen_server:start_link({local, Name}, ?MODULE, [Host], []).
gen_server:start_link({global, Name}, ?MODULE, [Host], []).
%%%===================================================================
%%% gen_server callbacks

View File

@ -21,7 +21,7 @@ post(Url, Body) when is_list(Url), is_binary(Body) ->
ok;
{error, Reason} ->
lager:warning("[iot_http_client] url: ~p, get error: ~p", [Url, Reason]),
{error, failed}
{error, Reason}
end;
{ok, HttpCode, _, ClientRef} ->
@ -31,10 +31,10 @@ post(Url, Body) when is_list(Url), is_binary(Body) ->
ok;
{error, Reason} ->
lager:warning("[iot_http_client] url: ~p, http_code: ~p, get error: ~p", [Url, HttpCode, Reason]),
{error, failed}
{error, Reason}
end;
{error, Reason} ->
lager:warning("[iot_http_client] url: ~p, get error: ~p", [Url, Reason]),
{error, failed}
{error, Reason}
end.