hyperkitty-chromium / src /hk_api_sup.erl
SNAPKITTYWEST's picture
Add src/hk_api_sup.erl
1540772 verified
Raw
History Blame Contribute Delete
763 Bytes
%%%-------------------------------------------------------------------
%%% @doc Supervises the HTTP/WebSocket API layer.
%%% @end
%%%-------------------------------------------------------------------
-module(hk_api_sup).
-behaviour(supervisor).
-export([start_link/0, init/1]).
start_link() ->
hk_sup_util:start_link_retry(
fun() -> supervisor:start_link({local, ?MODULE}, ?MODULE, []) end).
init([]) ->
SupFlags = #{strategy => one_for_one, intensity => 10, period => 10},
Children = [
#{id => hk_api_listener,
start => {hk_api_listener, start_link, []},
restart => permanent,
shutdown => 5000,
type => worker,
modules => [hk_api_listener]}
],
{ok, {SupFlags, Children}}.