summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Sackman <matthew@rabbitmq.com>2011-05-18 13:35:41 +0100
committerMatthew Sackman <matthew@rabbitmq.com>2011-05-18 13:35:41 +0100
commitce8a486e6e8fd08e78d696d0e31dd67fd0b5b670 (patch)
tree8b0b942a26f639a560b4c929fa6a70baf515155f
parent56ffe638d84646c2808b2b7a3bda0bae6a5ed933 (diff)
downloadrabbitmq-server-ce8a486e6e8fd08e78d696d0e31dd67fd0b5b670.tar.gz
Well it's no shorter, but it closer matches the original
-rw-r--r--src/rabbit_variable_queue.erl28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/rabbit_variable_queue.erl b/src/rabbit_variable_queue.erl
index 8e3cbada..df4b9c49 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)))).