couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vatam...@apache.org
Subject [1/2] couch-replicator commit: updated refs/heads/master to 05247a2
Date Tue, 26 Jul 2016 20:01:19 GMT
Repository: couchdb-couch-replicator
Updated Branches:
  refs/heads/master bf636d308 -> 05247a260


Replace hard-coded instances of <<"_replicator">> dbs with a macro

There are 3 of those. For now replace only those which refer to db names, not
role.

Jira: COUCHDB-3082


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

Branch: refs/heads/master
Commit: c661e74d2de99007804b6cb60489421d68fe406f
Parents: bf636d3
Author: Nick Vatamaniuc <vatamane@gmail.com>
Authored: Tue Jul 26 15:22:52 2016 -0400
Committer: Nick Vatamaniuc <vatamane@gmail.com>
Committed: Tue Jul 26 16:00:04 2016 -0400

----------------------------------------------------------------------
 src/couch_replicator_manager.erl | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/blob/c661e74d/src/couch_replicator_manager.erl
----------------------------------------------------------------------
diff --git a/src/couch_replicator_manager.erl b/src/couch_replicator_manager.erl
index 21d732f..dca1154 100644
--- a/src/couch_replicator_manager.erl
+++ b/src/couch_replicator_manager.erl
@@ -48,6 +48,7 @@
 -define(AVG_ERROR_DELAY_MSEC, 100).
 -define(MAX_ERROR_DELAY_MSEC, 60000).
 -define(OWNER, <<"owner">>).
+-define(REPLICATOR_DB, <<"_replicator">>).
 
 -define(DB_TO_SEQ, db_to_seq).
 -define(CTX, {user_ctx, #user_ctx{roles=[<<"_admin">>, <<"_replicator">>]}}).
@@ -175,8 +176,8 @@ init(_) ->
     Epoch = make_ref(),
     ScanPid = spawn_link(fun() -> scan_all_dbs(Server) end),
     % Automatically start node local changes feed loop
-    ensure_rep_db_exists(<<"_replicator">>),
-    Pid = start_changes_reader(<<"_replicator">>, 0, Epoch),
+    ensure_rep_db_exists(?REPLICATOR_DB),
+    Pid = start_changes_reader(?REPLICATOR_DB, 0, Epoch),
     {ok, #state{
         event_listener = start_event_listener(),
         scan_pid = ScanPid,
@@ -951,7 +952,7 @@ scan_all_dbs(Server) when is_pid(Server) ->
 	end, ok).
 
 is_replicator_db(DbName) ->
-    <<"_replicator">> =:= couch_db:dbname_suffix(DbName).
+    ?REPLICATOR_DB =:= couch_db:dbname_suffix(DbName).
 
 get_json_value(Key, Props) ->
     get_json_value(Key, Props, undefined).


Mime
View raw message