fix sup
This commit is contained in:
parent
f942f8090e
commit
9e11097b25
49
apps/iot/src/endpoint/endpoint_sup_sup.erl
Normal file
49
apps/iot/src/endpoint/endpoint_sup_sup.erl
Normal file
@ -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}}.
|
||||||
@ -47,12 +47,12 @@ init([]) ->
|
|||||||
},
|
},
|
||||||
|
|
||||||
#{
|
#{
|
||||||
id => 'endpoint_sup',
|
id => endpoint_sup_sup,
|
||||||
start => {'endpoint_sup', start_link, []},
|
start => {'endpoint_sup_sup', start_link, []},
|
||||||
restart => permanent,
|
restart => permanent,
|
||||||
shutdown => 2000,
|
shutdown => 2000,
|
||||||
type => supervisor,
|
type => supervisor,
|
||||||
modules => ['endpoint_sup']
|
modules => ['endpoint_sup_sup']
|
||||||
},
|
},
|
||||||
|
|
||||||
#{
|
#{
|
||||||
|
|||||||
@ -25,7 +25,7 @@
|
|||||||
{port, 18080}
|
{port, 18080}
|
||||||
]},
|
]},
|
||||||
|
|
||||||
{api_url, "http://39.98.184.67:8800/api/v1/taskLog"},
|
{api_url, "http://100.123.0.4/api/v1/"},
|
||||||
|
|
||||||
%% 目标服务器地址
|
%% 目标服务器地址
|
||||||
{emqx_server, [
|
{emqx_server, [
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user