summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Sackman <matthew@lshift.net>2010-01-21 11:16:07 +0000
committerMatthew Sackman <matthew@lshift.net>2010-01-21 11:16:07 +0000
commit042aeed7aa7c9310c15027a09cbadff30764f3d3 (patch)
tree6c587e501106227809c87e0cc2587cfdc0de9ae5
parent4733399267b441fe7ae906d3778d0e1d70e2d2bd (diff)
downloadrabbitmq-server-bug22218.tar.gz
fixed?bug22218
-rw-r--r--src/file_handle_cache.erl6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/file_handle_cache.erl b/src/file_handle_cache.erl
index 1b39d296..45c0eff3 100644
--- a/src/file_handle_cache.erl
+++ b/src/file_handle_cache.erl
@@ -735,11 +735,11 @@ process_obtains(State = #fhc_state { limit = Limit, count = Count })
process_obtains(State = #fhc_state { limit = Limit, count = Count,
obtains = Obtains }) ->
ObtainsLen = length(Obtains),
- Take = ObtainsLen - lists:min([ObtainsLen, Limit - Count]),
+ ObtainableLen = lists:min([ObtainsLen, Limit - Count]),
+ Take = ObtainsLen - ObtainableLen,
{ObtainsNew, ObtainableRev} = lists:split(Take, Obtains),
[gen_server:reply(From, ok) || From <- ObtainableRev],
- State #fhc_state { count = Count + length(ObtainableRev),
- obtains = ObtainsNew }.
+ State #fhc_state { count = Count + ObtainableLen, obtains = ObtainsNew }.
maybe_reduce(State = #fhc_state { limit = Limit, count = Count,
elders = Elders })