You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by da...@apache.org on 2014/02/06 17:43:42 UTC

[11/12] couch-index commit: updated refs/heads/import-rcouch to 4a5a0e3

add `make test` target . all erlang test pass

note: from time to time there is a timing issue on 200- test that need
to be fixed. It is most probably due to the way the indexer is
supervised.


Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch-index/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch-index/commit/f131b352
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch-index/tree/f131b352
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch-index/diff/f131b352

Branch: refs/heads/import-rcouch
Commit: f131b352f03b39d41e55f4c8be4999a3e0b50de2
Parents: b613268
Author: benoitc <be...@apache.org>
Authored: Thu Jan 9 16:24:32 2014 +0100
Committer: Paul J. Davis <pa...@gmail.com>
Committed: Thu Feb 6 10:41:51 2014 -0600

----------------------------------------------------------------------
 src/couch_index_server.erl | 12 +++++++-----
 src/couch_index_sup.erl    |  1 -
 2 files changed, 7 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch-index/blob/f131b352/src/couch_index_server.erl
----------------------------------------------------------------------
diff --git a/src/couch_index_server.erl b/src/couch_index_server.erl
index 7a7bd55..86791db 100644
--- a/src/couch_index_server.erl
+++ b/src/couch_index_server.erl
@@ -26,7 +26,8 @@
 -define(BY_DB, couchdb_indexes_by_db).
 
 
--record(st, {root_dir}).
+-record(st, {root_dir,
+             notifier_pid}).
 
 start_link() ->
     gen_server:start_link({local, ?MODULE}, ?MODULE, [], []).
@@ -73,10 +74,13 @@ init([]) ->
     ets:new(?BY_SIG, [protected, set, named_table]),
     ets:new(?BY_PID, [private, set, named_table]),
     ets:new(?BY_DB, [protected, bag, named_table]),
-    couch_db_update_notifier:start_link(fun ?MODULE:update_notify/1),
+
+    {ok, NotifierPid} = couch_db_update_notifier:start_link(
+            fun ?MODULE:update_notify/1),
     RootDir = couch_index_util:root_dir(),
     couch_file:init_delete_dir(RootDir),
-    {ok, #st{root_dir=RootDir}}.
+    {ok, #st{root_dir=RootDir,
+             notifier_pid=NotifierPid}}.
 
 
 terminate(_Reason, _State) ->
@@ -117,7 +121,6 @@ handle_cast({reset_indexes, DbName}, State) ->
     reset_indexes(DbName, State#st.root_dir),
     {noreply, State}.
 
-
 handle_info({'EXIT', Pid, Reason}, Server) ->
     case ets:lookup(?BY_PID, Pid) of
         [{Pid, {DbName, Sig}}] ->
@@ -198,4 +201,3 @@ update_notify({ddoc_updated, {DbName, DDocId}}) ->
         ets:match_object(?BY_DB, {DbName, {DDocId, '$1'}}));
 update_notify(_) ->
     ok.
-

http://git-wip-us.apache.org/repos/asf/couchdb-couch-index/blob/f131b352/src/couch_index_sup.erl
----------------------------------------------------------------------
diff --git a/src/couch_index_sup.erl b/src/couch_index_sup.erl
index d7b1033..fd97814 100644
--- a/src/couch_index_sup.erl
+++ b/src/couch_index_sup.erl
@@ -27,4 +27,3 @@ start_link() ->
 init([]) ->
     Server = ?CHILD(couch_index_server),
     {ok, {{one_for_one, 10, 3600}, [Server]}}.
-