Stage 1
This commit is contained in:
28
src/infra/infra_sup.erl
Normal file
28
src/infra/infra_sup.erl
Normal file
@@ -0,0 +1,28 @@
|
||||
%% Супервизор верхнего уровня
|
||||
-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}}.
|
||||
Reference in New Issue
Block a user