diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_mirror_queue_slave.erl | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/rabbit_mirror_queue_slave.erl b/src/rabbit_mirror_queue_slave.erl index 92a8ed9f2e..5d20aae4e5 100644 --- a/src/rabbit_mirror_queue_slave.erl +++ b/src/rabbit_mirror_queue_slave.erl @@ -894,12 +894,11 @@ set_delta(NewDelta, State = #state { depth_delta = Delta }) -> update_delta(_DeltaChange, State = #state { depth_delta = undefined }) -> State; update_delta(DeltaChange, State = #state { depth_delta = Delta }) -> - case {Delta, Delta + DeltaChange} of - {0, D} -> 0 = D, %% assertion: we cannot become unsync'ed - State; - {_, 0} -> ok = record_synchronised(State#state.q), - State #state { depth_delta = 0 }; - {_, D} when D > 0 -> State #state { depth_delta = D } + NewDelta = Delta + DeltaChange, + case Delta of + 0 -> 0 = NewDelta, %% assertion: we cannot become unsync'ed + State; + _ -> set_delta(NewDelta, State #state { depth_delta = undefined }) end. record_synchronised(#amqqueue { name = QName }) -> |
