diff --git a/apps/iot/src/endpoint/endpoint_sup_sup.erl b/apps/iot/src/endpoint/endpoint_sup_sup.erl new file mode 100644 index 0000000..8ff2b9b --- /dev/null +++ b/apps/iot/src/endpoint/endpoint_sup_sup.erl @@ -0,0 +1,49 @@ +%%%------------------------------------------------------------------- +%% @doc endpoint top level supervisor. +%% @end +%%%------------------------------------------------------------------- + +-module(endpoint_sup_sup). + +-behaviour(supervisor). +-include("endpoint.hrl"). + +-export([start_link/0]). +-export([init/1]). + +-define(SERVER, ?MODULE). + +start_link() -> + supervisor:start_link({local, ?SERVER}, ?MODULE, []). + +%% sup_flags() = #{strategy => strategy(), % optional +%% intensity => non_neg_integer(), % optional +%% period => pos_integer()} % optional +%% child_spec() = #{id => child_id(), % mandatory +%% start => mfargs(), % mandatory +%% restart => restart(), % optional +%% shutdown => shutdown(), % optional +%% type => worker(), % optional +%% modules => modules()} % optional +init([]) -> + SupFlags = #{strategy => one_for_all, intensity => 1000, period => 3600}, + ChildSpecs = [ + #{ + id => endpoint_subscription, + start => {'endpoint_subscription', start_link, []}, + restart => permanent, + shutdown => 2000, + type => worker, + modules => ['endpoint_subscription'] + }, + + #{ + id => 'endpoint_sup', + start => {'endpoint_sup', start_link, []}, + restart => permanent, + shutdown => 2000, + type => supervisor, + modules => ['endpoint_sup'] + } + ], + {ok, {SupFlags, ChildSpecs}}. \ No newline at end of file diff --git a/apps/iot/src/iot_sup.erl b/apps/iot/src/iot_sup.erl index 7d4c4b7..57ab0be 100644 --- a/apps/iot/src/iot_sup.erl +++ b/apps/iot/src/iot_sup.erl @@ -47,12 +47,12 @@ init([]) -> }, #{ - id => 'endpoint_sup', - start => {'endpoint_sup', start_link, []}, + id => endpoint_sup_sup, + start => {'endpoint_sup_sup', start_link, []}, restart => permanent, shutdown => 2000, type => supervisor, - modules => ['endpoint_sup'] + modules => ['endpoint_sup_sup'] }, #{ diff --git a/config/sys-dev.config b/config/sys-dev.config index 6b8578c..4e31089 100644 --- a/config/sys-dev.config +++ b/config/sys-dev.config @@ -25,7 +25,7 @@ {port, 18080} ]}, - {api_url, "http://39.98.184.67:8800/api/v1/taskLog"}, + {api_url, "http://100.123.0.4/api/v1/"}, %% 目标服务器地址 {emqx_server, [