fix device_sup
This commit is contained in:
parent
6ee341f2bd
commit
b6af63866f
@ -25,6 +25,9 @@ init([]) ->
|
||||
ensured_device_started(DeviceUUID) when is_binary(DeviceUUID) ->
|
||||
case iot_device:get_pid(DeviceUUID) of
|
||||
undefined ->
|
||||
%% 先删除,然后添加
|
||||
Id = iot_device:get_name(DeviceUUID),
|
||||
supervisor:delete_child(?MODULE, Id),
|
||||
case supervisor:start_child(?MODULE, child_spec(DeviceUUID)) of
|
||||
{ok, Pid} when is_pid(Pid) ->
|
||||
{ok, Pid};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user