From 30c0d6c1987b75432c37d9e8d2a012c569f26952 Mon Sep 17 00:00:00 2001 From: anlicheng Date: Tue, 15 Aug 2023 22:51:49 +0800 Subject: [PATCH] fix --- apps/iot/src/iot_host.erl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/iot/src/iot_host.erl b/apps/iot/src/iot_host.erl index a519935..5cb0581 100644 --- a/apps/iot/src/iot_host.erl +++ b/apps/iot/src/iot_host.erl @@ -135,6 +135,8 @@ start_link(Name, UUID) when is_atom(Name), is_binary(UUID) -> %% gen_statem:start_link/[3,4], this function is called by the new %% process to initialize. init([UUID]) -> + erlang:process_flag(trap_exit, true), + %% 重启时,认为主机是离线状态; 等待主机主动建立连接 {ok, _} = host_bo:change_status(UUID, ?HOST_OFFLINE),