Files
EventHubBack/src/infra/infra_sup.erl
T
aleksey 6c0775ee5e
CI / test (push) Failing after 5m58s
CI / deploy-ift (push) Has been skipped
CI / e2e-ift (push) Has been skipped
CI / deploy-stage (push) Has been skipped
CI / e2e-stage (push) Has been skipped
feat(infra): add TTL cleanup worker for append-only tables
Periodically prune old read notifications, revoked/expired auth sessions,
and admin_audit in chunked transactions; wire under eventhub config.
2026-08-03 22:57:41 +03:00

68 lines
2.0 KiB
Erlang
Executable File

%% ===================================================================
%% EventHub – инфраструктурный супервизор (с archive_manager)
%% ===================================================================
-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},
Children = [
#{id => infra_mnesia,
start => {infra_mnesia, start_link, []},
restart => permanent,
shutdown => 5000,
type => worker,
modules => [infra_mnesia]},
#{id => pg,
start => {pg, start_link, []},
restart => permanent,
type => worker},
#{id => pg_global,
start => {pg, start_link, [global]},
restart => permanent,
type => worker},
#{id => stats_collector,
start => {stats_collector, start_link, []},
restart => permanent,
shutdown => 5000,
type => worker,
modules => [stats_collector]},
#{id => node_monitor,
start => {node_monitor, start_link, []},
restart => permanent,
type => worker},
#{id => archive_manager,
start => {archive_manager, start_link, []},
restart => permanent,
shutdown => 5000,
type => worker,
modules => [archive_manager]},
#{id => migration_engine,
start => {migration_engine, start_link, []},
restart => permanent,
shutdown => 5000,
type => worker,
modules => [migration_engine]},
#{id => subscription_worker,
start => {subscription_worker, start_link, []},
restart => permanent,
shutdown => 5000,
type => worker,
modules => [subscription_worker]},
#{id => infra_cleanup,
start => {infra_cleanup, start_link, []},
restart => permanent,
shutdown => 5000,
type => worker,
modules => [infra_cleanup]}
],
{ok, {SupFlags, Children}}.