emqx/apps/emqx_license/src/emqx_license_sup.erl

47 lines
1.3 KiB
Erlang

%%--------------------------------------------------------------------
%% Copyright (c) 2022-2024 EMQ Technologies Co., Ltd. All Rights Reserved.
%%
%% @doc EMQX License Management Supervisor.
%%--------------------------------------------------------------------
-module(emqx_license_sup).
-behaviour(supervisor).
-export([start_link/0]).
-export([init/1]).
start_link() ->
supervisor:start_link({local, ?MODULE}, ?MODULE, []).
init([]) ->
{ok,
{
#{
strategy => one_for_one,
intensity => 10,
period => 100
},
[
#{
id => license_checker,
start => {emqx_license_checker, start_link, [fun emqx_license:read_license/0]},
restart => permanent,
shutdown => 5000,
type => worker,
modules => [emqx_license_checker]
},
#{
id => license_resources,
start => {emqx_license_resources, start_link, []},
restart => permanent,
shutdown => 5000,
type => worker,
modules => [emqx_license_resources]
}
]
}}.