fix
This commit is contained in:
parent
67b03e26fc
commit
dfc3fa5132
@ -13,7 +13,7 @@
|
||||
parse_trans,
|
||||
hackney,
|
||||
poolboy,
|
||||
|
||||
emqtt,
|
||||
mnesia,
|
||||
crypto,
|
||||
public_key,
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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.
|
||||
Loading…
x
Reference in New Issue
Block a user