fix
This commit is contained in:
parent
dc7aa27e4e
commit
16882a038e
@ -144,9 +144,7 @@ handle_request("POST", "/host/activate", _, #{<<"uuid">> := UUID, <<"auth">> :=
|
||||
{ok, 200, iot_util:json_error(400, <<"host not found">>)};
|
||||
{ok, Pid} when is_pid(Pid) ->
|
||||
ok = iot_host:activate(Pid, false),
|
||||
%% 激活的话不管是否存在会话都需要通知
|
||||
case iot_host:has_session(Pid) of
|
||||
true ->
|
||||
|
||||
lager:debug("[host_handler] activate host_id: ~p, start", [UUID]),
|
||||
BinReply = jiffy:encode(#{<<"auth">> => false}, [force_utf8]),
|
||||
case iot_host:publish_message(Pid, 8, BinReply) of
|
||||
@ -159,9 +157,6 @@ handle_request("POST", "/host/activate", _, #{<<"uuid">> := UUID, <<"auth">> :=
|
||||
end;
|
||||
{error, Reason} ->
|
||||
lager:debug("[iot_host] host_id uuid: ~p, publish command get error: ~p", [UUID, Reason])
|
||||
end;
|
||||
false ->
|
||||
ok
|
||||
end,
|
||||
{ok, 200, iot_util:json_data(<<"success">>)}
|
||||
end;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user