summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Newson <robert.newson@cloudant.com>2011-09-29 15:49:47 +0100
committerRobert Newson <robert.newson@cloudant.com>2011-09-29 15:49:47 +0100
commit33b60bad036c5268120b0d96f6a4abed6e35b7dc (patch)
tree5b097708aca8dbdda272020faef294df27293a3d
parentfc0d25038c76a654ba4a093b6f51949a4821488b (diff)
restore update_group for better update_after implementation.
-rw-r--r--apps/couch/src/couch_view_group.erl10
1 files changed, 10 insertions, 0 deletions
diff --git a/apps/couch/src/couch_view_group.erl b/apps/couch/src/couch_view_group.erl
index 87e4cd2e..75644d6b 100644
--- a/apps/couch/src/couch_view_group.erl
+++ b/apps/couch/src/couch_view_group.erl
@@ -221,6 +221,16 @@ handle_call({compact_done, NewGroup}, _From, State) ->
"compact: ~p", [DbName, GroupId, CurrentSeq, NewGroup#group.current_seq]),
{reply, update, State}.
+handle_cast({update_group, RequestSeq},
+ #group_state{
+ group=#group{current_seq=Seq}=Group,
+ updater_pid=nil}=State) when RequestSeq > Seq ->
+ Owner = self(),
+ Pid = spawn_link(fun()-> couch_view_updater:update(Owner, Group) end),
+ {noreply, State#group_state{updater_pid=Pid}};
+handle_cast({update_group, _RequestSeq}, State) ->
+ {noreply, State};
+
handle_cast({partial_update, Pid, NewGroup}, #group_state{updater_pid=Pid}
= State) ->
#group_state{