summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorAdam Kocoloski <adam@cloudant.com>2010-08-18 10:40:06 -0400
committerAdam Kocoloski <adam@cloudant.com>2010-08-27 16:34:31 -0400
commite4470d5017f098af9a9d7b3c0d92362d8eb90cce (patch)
tree643f4e529d4a0a31a8cb07b42194be32895b09e6 /apps
parent85d9b0116cfe58f4312c5b9746b74292f5c61150 (diff)
slightly better rexi_EXIT handling, needs more work
Diffstat (limited to 'apps')
-rw-r--r--apps/fabric/src/fabric_doc_update.erl8
1 files changed, 7 insertions, 1 deletions
diff --git a/apps/fabric/src/fabric_doc_update.erl b/apps/fabric/src/fabric_doc_update.erl
index c6ceaeab..50d02888 100644
--- a/apps/fabric/src/fabric_doc_update.erl
+++ b/apps/fabric/src/fabric_doc_update.erl
@@ -44,7 +44,13 @@ go(DbName, AllDocs, Opts) ->
handle_message({rexi_DOWN, _, _, _}, _Worker, Acc0) ->
skip_message(Acc0);
handle_message({rexi_EXIT, _}, _Worker, Acc0) ->
- skip_message(Acc0);
+ {WaitingCount, _, W, _, DocReplyDict} = Acc0,
+ if WaitingCount =:= 1 ->
+ {W, Reply} = dict:fold(fun force_reply/3, {W,[]}, DocReplyDict),
+ {stop, Reply};
+ true ->
+ {ok, setelement(1, Acc0, WaitingCount-1)}
+ end;
handle_message({ok, Replies}, Worker, Acc0) ->
{WaitingCount, DocCount, W, GroupedDocs, DocReplyDict0} = Acc0,
Docs = couch_util:get_value(Worker, GroupedDocs),