diff options
| author | Tim Watson <tim@rabbitmq.com> | 2013-03-07 15:10:49 +0000 |
|---|---|---|
| committer | Tim Watson <tim@rabbitmq.com> | 2013-03-07 15:10:49 +0000 |
| commit | c3ff3a26c3c82ba798b1464ef18abc518f3a9509 (patch) | |
| tree | ca9872a1db5f9fdee5e3ba58af9cfe0c250f60cb /src/gm.erl | |
| parent | da0756242b2a6790ef975cf36ea48e8b064c4dda (diff) | |
| parent | 2e665ace9e3202b0e89fdfb6910b74b9646e88ff (diff) | |
| download | rabbitmq-server-git-c3ff3a26c3c82ba798b1464ef18abc518f3a9509.tar.gz | |
merge default into bug23958
Diffstat (limited to 'src/gm.erl')
| -rw-r--r-- | src/gm.erl | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/gm.erl b/src/gm.erl index 4a95de0dd1..76b535e696 100644 --- a/src/gm.erl +++ b/src/gm.erl @@ -11,7 +11,7 @@ %% The Original Code is RabbitMQ. %% %% The Initial Developer of the Original Code is VMware, Inc. -%% Copyright (c) 2007-2012 VMware, Inc. All rights reserved. +%% Copyright (c) 2007-2013 VMware, Inc. All rights reserved. %% -module(gm). @@ -667,6 +667,9 @@ handle_info(flush, State) -> noreply( flush_broadcast_buffer(State #state { broadcast_timer = undefined })); +handle_info(timeout, State) -> + noreply(flush_broadcast_buffer(State)); + handle_info({'DOWN', MRef, process, _Pid, Reason}, State = #state { self = Self, left = Left, @@ -834,10 +837,13 @@ handle_msg({activity, _NotLeft, _Activity}, State) -> noreply(State) -> - {noreply, ensure_broadcast_timer(State), hibernate}. + {noreply, ensure_broadcast_timer(State), flush_timeout(State)}. reply(Reply, State) -> - {reply, Reply, ensure_broadcast_timer(State), hibernate}. + {reply, Reply, ensure_broadcast_timer(State), flush_timeout(State)}. + +flush_timeout(#state{broadcast_buffer = []}) -> hibernate; +flush_timeout(_) -> 0. ensure_broadcast_timer(State = #state { broadcast_buffer = [], broadcast_timer = undefined }) -> |
