Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

WHISTLE-1441: update sup child specs

  • Loading branch information...
commit 0922af92e380d4589a9ad37a828432a9ef7d767f 1 parent 6a7589f
@jamesaimonetti jamesaimonetti authored
Showing with 9 additions and 12 deletions.
  1. +9 −12 whistle_apps/apps/acdc/src/acdc_sup.erl
View
21 whistle_apps/apps/acdc/src/acdc_sup.erl
@@ -19,28 +19,25 @@
-export([init/1]).
%% Helper macro for declaring children of supervisor
--define(CHILD(I, Type), {I, {I, start_link, []}, permanent, 5000, Type, [I]}).
-
--define(CHILDREN, [{acdc_agents_sup, supervisor}
- ,{acdc_queues_sup, supervisor}
- ,{acdc_stats, worker}
-%% ,{acdc_queue_manager, worker}
- ,{acdc_agent_manager, worker}
- ,{acdc_init, worker}
- ,{acdc_listener, worker}
+-define(CHILD(I, Type, Timeout), {I, {I, start_link, []}, permanent, Timeout, Type, [I]}).
+
+-define(CHILDREN, [{acdc_agents_sup, supervisor, infinity}
+ ,{acdc_queues_sup, supervisor, infinity}
+ ,{acdc_stats, worker, 5000}
+ ,{acdc_agent_manager, worker, 5000}
+ ,{acdc_init, worker, 5000}
+ ,{acdc_listener, worker, 5000}
]).
%% ===================================================================
%% API functions
%% ===================================================================
-
start_link() ->
supervisor:start_link({local, ?MODULE}, ?MODULE, []).
%% ===================================================================
%% Supervisor callbacks
%% ===================================================================
-
-spec init([]) -> sup_init_ret().
init([]) ->
RestartStrategy = one_for_one,
@@ -48,5 +45,5 @@ init([]) ->
MaxSecondsBetweenRestarts = 10,
SupFlags = {RestartStrategy, MaxRestarts, MaxSecondsBetweenRestarts},
- Children = [?CHILD(Name, Type) || {Name, Type} <- ?CHILDREN],
+ Children = [?CHILD(Name, Type, Timeout) || {Name, Type, Timeout} <- ?CHILDREN],
{ok, {SupFlags, Children}}.
Please sign in to comment.
Something went wrong with that request. Please try again.