diff options
author | Matthias Radestock <matthias@rabbitmq.com> | 2013-01-10 15:12:46 +0000 |
---|---|---|
committer | Matthias Radestock <matthias@rabbitmq.com> | 2013-01-10 15:12:46 +0000 |
commit | 68ede92e82dcdfc73b36f0e5f506da5e43c4f044 (patch) | |
tree | 1850de3b1f4e60296c047c4c6756a028643f047f /src/rabbit_alarm.erl | |
parent | 626142a346e5d7cf25f1b249c518b2e723c8d83a (diff) | |
download | rabbitmq-server-68ede92e82dcdfc73b36f0e5f506da5e43c4f044.tar.gz |
send connection.{blocked,unblocked}
Diffstat (limited to 'src/rabbit_alarm.erl')
-rw-r--r-- | src/rabbit_alarm.erl | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/rabbit_alarm.erl b/src/rabbit_alarm.erl index d7d4d82a..55b71820 100644 --- a/src/rabbit_alarm.erl +++ b/src/rabbit_alarm.erl @@ -37,7 +37,7 @@ -spec(start_link/0 :: () -> rabbit_types:ok_pid_or_error()). -spec(start/0 :: () -> 'ok'). -spec(stop/0 :: () -> 'ok'). --spec(register/2 :: (pid(), rabbit_types:mfargs()) -> boolean()). +-spec(register/2 :: (pid(), rabbit_types:mfargs()) -> [atom()]). -spec(set_alarm/1 :: (any()) -> 'ok'). -spec(clear_alarm/1 :: (any()) -> 'ok'). -spec(on_node_up/1 :: (node()) -> 'ok'). @@ -94,8 +94,9 @@ init([]) -> alarmed_nodes = dict:new(), alarms = []}}. -handle_call({register, Pid, HighMemMFA}, State) -> - {ok, 0 < dict:size(State#alarms.alarmed_nodes), +handle_call({register, Pid, HighMemMFA}, State = #alarms{alarmed_nodes = AN}) -> + Vs = [V || {_, V} <- dict:to_list(AN)], + {ok, lists:usort(lists:append(Vs)), internal_register(Pid, HighMemMFA, State)}; handle_call(get_alarms, State = #alarms{alarms = Alarms}) -> |