diff options
author | Simon MacMullen <simon@rabbitmq.com> | 2013-04-16 11:59:32 +0100 |
---|---|---|
committer | Simon MacMullen <simon@rabbitmq.com> | 2013-04-16 11:59:32 +0100 |
commit | 6f62904acb649bf989ffd55f17fa8a29c5dfbf5b (patch) | |
tree | c1d484d439129368825bf1d3faead143f0340e1d /src/rabbit_alarm.erl | |
parent | 13d5ac8c71cea4835be5e6d42e66d5c6cf36b20f (diff) | |
parent | 6329f18b431e6e83558938479d7c5c3f0b27677e (diff) | |
download | rabbitmq-server-6f62904acb649bf989ffd55f17fa8a29c5dfbf5b.tar.gz |
Merge default
Diffstat (limited to 'src/rabbit_alarm.erl')
-rw-r--r-- | src/rabbit_alarm.erl | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/rabbit_alarm.erl b/src/rabbit_alarm.erl index 6d24d130..17f1edcf 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'). @@ -93,8 +93,8 @@ init([]) -> alarmed_nodes = dict:new(), alarms = []}}. -handle_call({register, Pid, AlertMFA}, State) -> - {ok, 0 < dict:size(State#alarms.alarmed_nodes), +handle_call({register, Pid, AlertMFA}, State = #alarms{alarmed_nodes = AN}) -> + {ok, lists:usort(lists:append([V || {_, V} <- dict:to_list(AN)])), internal_register(Pid, AlertMFA, State)}; handle_call(get_alarms, State = #alarms{alarms = Alarms}) -> |