diff options
| author | Francesco Mazzoli <francesco@rabbitmq.com> | 2012-08-31 18:40:05 +0100 |
|---|---|---|
| committer | Francesco Mazzoli <francesco@rabbitmq.com> | 2012-08-31 18:40:05 +0100 |
| commit | e2733fe49271fd4ee6079e272a3309cbdf8e99eb (patch) | |
| tree | 1c05e71d74941c6d38c28e32284dfa16e7f3e85b | |
| parent | 3e3c5bcc7eb134d642057ba23ebe226445ce1bee (diff) | |
| download | rabbitmq-server-git-e2733fe49271fd4ee6079e272a3309cbdf8e99eb.tar.gz | |
use `set_synchronized' instead than manually increasing
| -rw-r--r-- | src/rabbit_mirror_queue_slave.erl | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/rabbit_mirror_queue_slave.erl b/src/rabbit_mirror_queue_slave.erl index 75c88b15a3..d79067bec6 100644 --- a/src/rabbit_mirror_queue_slave.erl +++ b/src/rabbit_mirror_queue_slave.erl @@ -833,8 +833,7 @@ process_instruction({set_length, Length, Dropped, AckRequired}, end}; process_instruction({fetch, AckRequired, MsgId, Remaining}, State = #state { backing_queue = BQ, - backing_queue_state = BQS, - external_pending = ExtPending }) -> + backing_queue_state = BQS }) -> QLen = BQ:len(BQS), {ok, case {QLen - 1, AckRequired} of {Remaining, _} -> @@ -845,10 +844,7 @@ process_instruction({fetch, AckRequired, MsgId, Remaining}, {_, false} when QLen =< Remaining -> set_synchronised(Remaining, State); {_, true} when QLen =< Remaining -> - State #state { external_pending = case ExtPending of - undefined -> undefined; - _ -> ExtPending + 1 - end } + set_synchronised(1, Remaining, State) end}; process_instruction({ack, MsgIds, Length}, State = #state { backing_queue = BQ, |
