From 33b60bad036c5268120b0d96f6a4abed6e35b7dc Mon Sep 17 00:00:00 2001 From: Robert Newson Date: Thu, 29 Sep 2011 15:49:47 +0100 Subject: restore update_group for better update_after implementation. --- apps/couch/src/couch_view_group.erl | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'apps') 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{ -- cgit v1.2.3