Skip to content

Commit 2deb28e

Browse files
committed
Spawn elysium connections when elysium_queue activate runs
1 parent fcabe89 commit 2deb28e

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/elysium_queue.erl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ terminate(Reason, _State_Name,
228228
%% @doc Activate if requested, from the 'INACTIVE' state.
229229
?inactive(activate, #ef_state{connection_sup=Conn_Sup, config=Config} = State) ->
230230
Max_Sessions = elysium_config:session_max_count(Config),
231-
_ = [elysium_connection_sup:start_child(Conn_Sup, [Config])
231+
_ = [spawn_monitor(elysium_connection_sup, start_child, [Conn_Sup, [Config]])
232232
|| _N <- lists:seq(1, Max_Sessions)],
233233
{next_state, ?active, State};
234234
?inactive(_Other, #ef_state{} = State) ->
@@ -300,5 +300,9 @@ handle_event(_Any, State_Name, #ef_state{} = State) ->
300300
State :: #ef_state{}.
301301
%% @private
302302
%% @doc Unused function.
303+
handle_info ({'DOWN', _Ref, process, _Connection_Attempt, normal}, State_Name, #ef_state{} = State) ->
304+
{next_state, State_Name, State};
305+
handle_info ({'DOWN', _Ref, process, Connection_Attempt, Reason}, State_Name, #ef_state{} = State) ->
306+
lager:warn("Elysium connection in process ~p could not be established: ~p~n", [Connection_Attempt, Reason]);
303307
handle_info (_Any, State_Name, #ef_state{} = State) ->
304308
{next_state, State_Name, State}.

0 commit comments

Comments
 (0)