diff options
| author | Matthew Sackman <matthew@rabbitmq.com> | 2011-05-18 13:35:41 +0100 |
|---|---|---|
| committer | Matthew Sackman <matthew@rabbitmq.com> | 2011-05-18 13:35:41 +0100 |
| commit | 2126828816af3361dd3e221e1b85a94412891a87 (patch) | |
| tree | 8b0b942a26f639a560b4c929fa6a70baf515155f | |
| parent | 9b539289a1c122c791112d70f470a696fd5e45f1 (diff) | |
| download | rabbitmq-server-git-2126828816af3361dd3e221e1b85a94412891a87.tar.gz | |
Well it's no shorter, but it closer matches the original
| -rw-r--r-- | src/rabbit_variable_queue.erl | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/rabbit_variable_queue.erl b/src/rabbit_variable_queue.erl index 8e3cbada34..df4b9c499f 100644 --- a/src/rabbit_variable_queue.erl +++ b/src/rabbit_variable_queue.erl @@ -831,20 +831,20 @@ ram_duration(State = #vqstate { ram_ack_count_prev = RamAckCount }}. -needs_timeout(State = #vqstate { on_sync = ?BLANK_SYNC }) -> - case needs_index_sync(State) of - true -> timed; - false -> case reduce_memory_use(fun (_Quota, State1) -> {0, State1} end, - fun (_Quota, State1) -> State1 end, - fun (State1) -> State1 end, - fun (_Quota, State1) -> {0, State1} end, - State) of - {true, _State} -> idle; - {false, _State} -> false - end - end; -needs_timeout(_State) -> - timed. +needs_timeout(State = #vqstate { on_sync = OnSync }) -> + case {OnSync, needs_index_sync(State)} of + {?BLANK_SYNC, false} -> + case reduce_memory_use(fun (_Quota, State1) -> {0, State1} end, + fun (_Quota, State1) -> State1 end, + fun (State1) -> State1 end, + fun (_Quota, State1) -> {0, State1} end, + State) of + {true, _State} -> idle; + {false, _State} -> false + end; + _ -> + timed + end. idle_timeout(State) -> a(reduce_memory_use(confirm_commit_index(tx_commit_index(State)))). |
