diff options
Diffstat (limited to 'apps/couch/src')
-rw-r--r-- | apps/couch/src/couch_view_group.erl | 10 |
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{ |