summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_variable_queue.erl3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/rabbit_variable_queue.erl b/src/rabbit_variable_queue.erl
index 6f6f3d923d..a558b02239 100644
--- a/src/rabbit_variable_queue.erl
+++ b/src/rabbit_variable_queue.erl
@@ -640,7 +640,8 @@ needs_idle_timeout(State = #vqstate { target_ram_msg_count = TargetRamMsgCount,
ram_msg_count = RamMsgCount,
ram_index_count = RamIndexCount}) ->
case reduction(RamMsgCount, TargetRamMsgCount) of
- 0 -> reduction(RamIndexCount, State) == ?IO_BATCH_SIZE;
+ 0 -> Permitted = permitted_ram_index_count(State),
+ reduction(RamIndexCount, Permitted) == ?IO_BATCH_SIZE;
_ -> true
end.