28 lines
674 B
Erlang
28 lines
674 B
Erlang
%% Супервизор верхнего уровня
|
|
-module(infra_sup).
|
|
-behaviour(supervisor).
|
|
|
|
-export([start_link/0]).
|
|
-export([init/1]).
|
|
|
|
start_link() ->
|
|
supervisor:start_link({local, ?MODULE}, ?MODULE, []).
|
|
|
|
init([]) ->
|
|
SupFlags = #{strategy => one_for_one, intensity => 5, period => 10},
|
|
|
|
Mnesia = #{
|
|
id => infra_mnesia,
|
|
start => {infra_mnesia, start_link, []},
|
|
restart => permanent,
|
|
shutdown => 5000,
|
|
type => worker,
|
|
modules => [infra_mnesia]
|
|
},
|
|
|
|
% Временная заглушка для HTTP-сервера (будет добавлен позже)
|
|
% Cowboy = #{...}
|
|
|
|
ChildSpecs = [Mnesia],
|
|
|
|
{ok, {SupFlags, ChildSpecs}}. |