summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_variable_queue.erl16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/rabbit_variable_queue.erl b/src/rabbit_variable_queue.erl
index a4d18b50ff..28b7830e7d 100644
--- a/src/rabbit_variable_queue.erl
+++ b/src/rabbit_variable_queue.erl
@@ -734,10 +734,18 @@ ram_duration(State = #vqstate {
needs_timeout(State = #vqstate { index_state = IndexState }) ->
case needs_index_sync(State) of
true -> timed;
- false -> case rabbit_queue_index:needs_sync(IndexState) of
- true -> idle;
- false -> false
- end
+ false ->
+ case rabbit_queue_index:needs_sync(IndexState) of
+ true -> idle;
+ false -> case reduce_memory_use(
+ fun (_Quota, State1) -> {0, State1} end,
+ fun (_Quota, State1) -> State1 end,
+ fun (_Quota, State1) -> {0, State1} end,
+ State) of
+ {true, _State} -> idle;
+ {false, _State} -> false
+ end
+ end
end.
timeout(State = #vqstate { index_state = IndexState }) ->