Skip to content

Commit

Permalink
v1.51: gen_listener waits a bit before reconnecting its queue(s)
Browse files Browse the repository at this point in the history
  • Loading branch information
James Aimonetti committed Mar 26, 2012
1 parent a034530 commit b14e3d6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/whistle-1.0.0/src/gen_listener.erl
Expand Up @@ -366,7 +366,9 @@ handle_info({'EXIT', Pid, _Reason}=Message, #state{active_responders=ARs}=State)
end;

handle_info({amqp_host_down, _H}=Down, #state{bindings=Bindings, params=Params}=State) ->
timer:sleep(random:uniform(150)+100), % wait a bit before reconnecting, so we don't slam amqp_mgr
lager:alert("amqp host down msg: ~p", [_H]),

case amqp_util:is_host_available() of
true ->
lager:debug("host is available, let's try wiring up"),
Expand Down

0 comments on commit b14e3d6

Please sign in to comment.