diff options
| author | Matthias Radestock <matthias@rabbitmq.com> | 2011-03-15 17:25:45 +0000 |
|---|---|---|
| committer | Matthias Radestock <matthias@rabbitmq.com> | 2011-03-15 17:25:45 +0000 |
| commit | b31bc7927d46eb3eeb89250a86dacab0d55989fd (patch) | |
| tree | baa6d78c8b59efd382fcd177006b1fdff2f2dd81 | |
| parent | 819b5c1624a4f8b07eafb4c382e25e3153c37dfa (diff) | |
| parent | f424d34e56d68d34938f386134a59ae48326ae2b (diff) | |
| download | rabbitmq-server-git-b31bc7927d46eb3eeb89250a86dacab0d55989fd.tar.gz | |
merge bug23948 into default
| -rw-r--r-- | src/file_handle_cache.erl | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/file_handle_cache.erl b/src/file_handle_cache.erl index b26bb9884b..4f0365718f 100644 --- a/src/file_handle_cache.erl +++ b/src/file_handle_cache.erl @@ -1149,11 +1149,12 @@ notify_age(CStates, AverageAge) -> end, CStates). notify_age0(Clients, CStates, Required) -> - Notifications = - [CState || CState <- CStates, CState#cstate.callback =/= undefined], - {L1, L2} = lists:split(random:uniform(length(Notifications)), - Notifications), - notify(Clients, Required, L2 ++ L1). + case [CState || CState <- CStates, CState#cstate.callback =/= undefined] of + [] -> ok; + Notifications -> S = random:uniform(length(Notifications)), + {L1, L2} = lists:split(S, Notifications), + notify(Clients, Required, L2 ++ L1) + end. notify(_Clients, _Required, []) -> ok; |
