fix device_sup

This commit is contained in:
anlicheng 2024-12-13 11:57:02 +08:00
parent 6ee341f2bd
commit b6af63866f

View File

@ -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};