From cc10502a58a20a5209f5d49d2b25f50e17ffedd1 Mon Sep 17 00:00:00 2001 From: anlicheng Date: Mon, 25 Sep 2023 16:50:17 +0800 Subject: [PATCH] fix iot_app --- apps/iot/src/iot_app.erl | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/apps/iot/src/iot_app.erl b/apps/iot/src/iot_app.erl index e734133..2cbe8b9 100644 --- a/apps/iot/src/iot_app.erl +++ b/apps/iot/src/iot_app.erl @@ -13,21 +13,18 @@ start(_StartType, _StartArgs) -> io:setopts([{encoding, unicode}]), - %% 启动数据库 - start_mnesia(), - %% 导入固定数据到mnesia - %% 加速内存的回收 erlang:system_flag(fullsweep_after, 16), + + {ok, SupPid} = iot_sup:start_link(), + %% 启动数据库 + start_mnesia(), %% 启动udp服务 start_udp_server(), %% 启动http服务 start_http_server(), - %% 启动连接池 - ok = hackney_pool:start_pool(influx_pool, [{timeout, 150000}, {max_connections, 100}]), - - iot_sup:start_link(). + {ok, SupPid}. stop(_State) -> ok.