fix endpoint
This commit is contained in:
parent
4405483b9d
commit
d0c38854e4
@ -30,16 +30,16 @@ start_link() ->
|
|||||||
init([]) ->
|
init([]) ->
|
||||||
SupFlags = #{strategy => one_for_one, intensity => 1000, period => 3600},
|
SupFlags = #{strategy => one_for_one, intensity => 1000, period => 3600},
|
||||||
Endpoints = iot_api:get_all_endpoints(),
|
Endpoints = iot_api:get_all_endpoints(),
|
||||||
ChildSpecs = lists:flatmap(fun(EndpointInfo) ->
|
ChildSpecs = lists:filtermap(fun(EndpointInfo) ->
|
||||||
case endpoint:endpoint_record(EndpointInfo) of
|
case endpoint:endpoint_record(EndpointInfo) of
|
||||||
error ->
|
error ->
|
||||||
[];
|
false;
|
||||||
{ok, Endpoint} ->
|
{ok, Endpoint} ->
|
||||||
case endpoint:is_support(endpoint:get_protocol(Endpoint)) of
|
case endpoint:is_support(endpoint:get_protocol(Endpoint)) of
|
||||||
true ->
|
true ->
|
||||||
[child_spec(Endpoint)];
|
{true, child_spec(Endpoint)};
|
||||||
false ->
|
false ->
|
||||||
[]
|
false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end, Endpoints),
|
end, Endpoints),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user