summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorAdam Kocoloski <adam@cloudant.com>2010-08-12 09:03:46 -0400
committerAdam Kocoloski <adam@cloudant.com>2010-08-27 16:25:15 -0400
commit81121469814e363988c650992759e21f04271ae8 (patch)
tree7858e17e2115ab01ffec971b9b916c6a50c52a51 /apps
parent153504e3665654def448539fafc592833e01f95b (diff)
resume reducers after the row is sent, BugzID 10683
Diffstat (limited to 'apps')
-rw-r--r--apps/fabric/src/fabric_view.erl5
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/fabric/src/fabric_view.erl b/apps/fabric/src/fabric_view.erl
index 1558d301..e5f19b73 100644
--- a/apps/fabric/src/fabric_view.erl
+++ b/apps/fabric/src/fabric_view.erl
@@ -161,7 +161,10 @@ get_next_row(#collector{reducer = RedSrc} = St) when RedSrc =/= undefined ->
Wrapped = [[V] || #view_row{value=V} <- Records],
{ok, [Reduced]} = couch_query_servers:rereduce(Proc, [RedSrc], Wrapped),
NewSt = St#collector{keys=RestKeys, rows=NewRowDict, counters=Counters},
- {#view_row{key=Key, id=reduced, value=Reduced}, NewSt};
+ NewState = lists:foldl(fun(#view_row{worker=Worker}, StateAcc) ->
+ maybe_resume_worker(Worker, StateAcc)
+ end, NewSt, Records),
+ {#view_row{key=Key, id=reduced, value=Reduced}, NewState};
error ->
get_next_row(St#collector{keys=RestKeys})
end;