fix
This commit is contained in:
parent
1af2666272
commit
103513b635
@ -78,11 +78,11 @@ handle_request("POST", "/endpoint/restart", _, #{<<"id">> := Id}) when is_intege
|
|||||||
lager:warning("[endpoint_handler] start endpoint: ~p, get error: ~p", [Title, Reason]),
|
lager:warning("[endpoint_handler] start endpoint: ~p, get error: ~p", [Title, Reason]),
|
||||||
{ok, 200, iot_util:json_error(404, <<"restart endpoint error">>)}
|
{ok, 200, iot_util:json_error(404, <<"restart endpoint error">>)}
|
||||||
end;
|
end;
|
||||||
Pid ->
|
Pid when is_pid(Pid) ->
|
||||||
case endpoint_sup:delete_endpoint(Id) of
|
case endpoint_sup:delete_endpoint(Id) of
|
||||||
ok ->
|
ok ->
|
||||||
case endpoint_sup:ensured_endpoint_started(Endpoint) of
|
case endpoint_sup:ensured_endpoint_started(Endpoint) of
|
||||||
{ok, Pid} when is_pid(Pid) ->
|
{ok, Pid0} when is_pid(Pid0) ->
|
||||||
{ok, 200, iot_util:json_data(<<"success">>)};
|
{ok, 200, iot_util:json_data(<<"success">>)};
|
||||||
{error, Reason} ->
|
{error, Reason} ->
|
||||||
lager:warning("[endpoint_handler] start endpoint: ~p, get error: ~p", [Title, Reason]),
|
lager:warning("[endpoint_handler] start endpoint: ~p, get error: ~p", [Title, Reason]),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user