diff options
author | dcorbacho <dparracorbacho@piotal.io> | 2021-02-25 11:27:40 +0100 |
---|---|---|
committer | dcorbacho <dparracorbacho@piotal.io> | 2021-02-25 11:27:40 +0100 |
commit | 6778c1fea3227c3fba9bc495d53648fea739eb20 (patch) | |
tree | e94cda3fdc88e580827a02ba43d69699a5b436e2 | |
parent | 8592291afade52091eaa6860febe9ef5b42c490c (diff) | |
download | rabbitmq-server-git-6778c1fea3227c3fba9bc495d53648fea739eb20.tar.gz |
Small code enhancements
-rw-r--r-- | deps/rabbit/src/rabbit_fifo.erl | 8 | ||||
-rw-r--r-- | deps/rabbit/src/rabbit_quorum_queue.erl | 3 |
2 files changed, 6 insertions, 5 deletions
diff --git a/deps/rabbit/src/rabbit_fifo.erl b/deps/rabbit/src/rabbit_fifo.erl index ee2ceb0298..2755c9c0a0 100644 --- a/deps/rabbit/src/rabbit_fifo.erl +++ b/deps/rabbit/src/rabbit_fifo.erl @@ -1530,7 +1530,7 @@ checkout(#{index := Index} = Meta, #?MODULE{cfg = #cfg{resource = QName}} = OldS Effects0, {#{}, #{}}), case evaluate_limit(Index, false, OldState, State1, Effects1) of {State, true, Effects} -> - case have_active_consumers_changed(State, HandleConsumerChanges) of + case maybe_notify_decorators(State, HandleConsumerChanges) of {true, {MaxActivePriority, IsEmpty}} -> NotifyEffect = notify_decorators_effect(QName, MaxActivePriority, IsEmpty), update_smallest_raft_index(Index, State, [NotifyEffect | Effects]); @@ -1538,7 +1538,7 @@ checkout(#{index := Index} = Meta, #?MODULE{cfg = #cfg{resource = QName}} = OldS update_smallest_raft_index(Index, State, Effects) end; {State, false, Effects} -> - case have_active_consumers_changed(State, HandleConsumerChanges) of + case maybe_notify_decorators(State, HandleConsumerChanges) of {true, {MaxActivePriority, IsEmpty}} -> NotifyEffect = notify_decorators_effect(QName, MaxActivePriority, IsEmpty), {State, ok, [NotifyEffect | Effects]}; @@ -2164,9 +2164,9 @@ get_priority_from_args(#{args := Args}) -> get_priority_from_args(_) -> 0. -have_active_consumers_changed(_, false) -> +maybe_notify_decorators(_, false) -> false; -have_active_consumers_changed(State, _) -> +maybe_notify_decorators(State, _) -> {true, query_notify_decorators_info(State)}. notify_decorators_effect(#?MODULE{cfg = #cfg{resource = QName}} = State) -> diff --git a/deps/rabbit/src/rabbit_quorum_queue.erl b/deps/rabbit/src/rabbit_quorum_queue.erl index f76d984a5d..b0d014b90f 100644 --- a/deps/rabbit/src/rabbit_quorum_queue.erl +++ b/deps/rabbit/src/rabbit_quorum_queue.erl @@ -1552,7 +1552,8 @@ notify_decorators(Q) when ?is_amqqueue(Q) -> _ -> ok end. -notify_decorators(QName, Event) -> notify_decorators(QName, Event, []). +notify_decorators(QName, Event) -> + notify_decorators(QName, Event, []). notify_decorators(QName, F, A) -> %% Look up again in case policy and hence decorators have changed |