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 648e465
Date Wed, 08 Feb 2017 18:12:03 GMT
Repository: couchdb-couch-replicator
Updated Branches:
  refs/heads/master 1644696c8 -> 648e465f5


Switch replicator max_document_id_length config to use infinity

Default value switched to be `infinity` instead of 0

COUCHDB-3291


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/46f70c73
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/tree/46f70c73
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/diff/46f70c73

Branch: refs/heads/master
Commit: 46f70c73427e618774872a388287ba682c1376f1
Parents: b18b31c
Author: Nick Vatamaniuc <vatamane@apache.org>
Authored: Wed Feb 8 11:46:13 2017 -0500
Committer: Nick Vatamaniuc <vatamane@apache.org>
Committed: Wed Feb 8 11:46:13 2017 -0500

----------------------------------------------------------------------
 src/couch_replicator_changes_reader.erl     | 9 +++++++--
 test/couch_replicator_id_too_long_tests.erl | 2 +-
 2 files changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/blob/46f70c73/src/couch_replicator_changes_reader.erl
----------------------------------------------------------------------
diff --git a/src/couch_replicator_changes_reader.erl b/src/couch_replicator_changes_reader.erl
index f9d9097..439f5c9 100644
--- a/src/couch_replicator_changes_reader.erl
+++ b/src/couch_replicator_changes_reader.erl
@@ -123,5 +123,10 @@ process_change({last_seq, _}, _) ->
     ok.
 
 is_doc_id_too_long(IdLength) ->
-    ConfigMax = config:get_integer("replicator", "max_document_id_length", 0),
-    ConfigMax > 0 andalso IdLength > ConfigMax.
+    case config:get("replicator", "max_document_id_length", "infinity") of
+        "infinity" ->
+            false;
+        ConfigMaxStr ->
+            ConfigMax = list_to_integer(ConfigMaxStr),
+            ConfigMax > 0 andalso IdLength > ConfigMax
+    end.

http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/blob/46f70c73/test/couch_replicator_id_too_long_tests.erl
----------------------------------------------------------------------
diff --git a/test/couch_replicator_id_too_long_tests.erl b/test/couch_replicator_id_too_long_tests.erl
index f5d7165..70eda05 100644
--- a/test/couch_replicator_id_too_long_tests.erl
+++ b/test/couch_replicator_id_too_long_tests.erl
@@ -28,7 +28,7 @@ setup(_) ->
 teardown(_, {Ctx, {Source, Target}}) ->
     delete_db(Source),
     delete_db(Target),
-    config:set("replicator", "max_document_id_length", "0"),
+    config:set("replicator", "max_document_id_length", "infinity"),
     ok = test_util:stop_couch(Ctx).
 
 


Mime
View raw message