%%% Copyright (c) 2017, NORDUnet A/S. %%% See LICENSE for licensing information. -module(merge_fetch_newentries_sup). -behaviour(supervisor). -export([start_link/1, init/1]). start_link(Nodes) -> {ok, Pid} = supervisor:start_link({local, ?MODULE}, ?MODULE, []), Children = lists:map(fun({NodeName, NodeAddress}) -> lager:info("starting newentry worker: ~p", [NodeName]), {ok, Child} = supervisor:start_child( ?MODULE, [{NodeName, NodeAddress, 3000}]), Child end, Nodes), lager:debug("~p started newentry workers: ~p", [Pid, Children]), {ok, Pid}. init([]) -> {ok, {{simple_one_for_one, 3, 10}, [{ignored, {merge_fetch_newentries, start_link, []}, permanent, 10000, worker, [merge_fetch_newentries]}]}}.