You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by fd...@apache.org on 2011/05/08 14:52:14 UTC

svn commit: r1100728 - /couchdb/trunk/src/couchdb/couch_replicator.erl

Author: fdmanana
Date: Sun May  8 12:52:14 2011
New Revision: 1100728

URL: http://svn.apache.org/viewvc?rev=1100728&view=rev
Log:
Replicator: ensure each worker gets at least 1 connection

Modified:
    couchdb/trunk/src/couchdb/couch_replicator.erl

Modified: couchdb/trunk/src/couchdb/couch_replicator.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_replicator.erl?rev=1100728&r1=1100727&r2=1100728&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_replicator.erl (original)
+++ couchdb/trunk/src/couchdb/couch_replicator.erl Sun May  8 12:52:14 2011
@@ -238,7 +238,8 @@ do_init(#rep{options = Options, id = {Ba
     % MissingRevsQueue and copy them from the source to the target database.
     MaxHttpConns = get_value(http_connections, Options),
     HttpPipeSize = get_value(http_pipeline_size, Options),
-    MaxParallelConns = (MaxHttpConns * HttpPipeSize) div CopiersCount,
+    MaxParallelConns = lists:max(
+        [(MaxHttpConns * HttpPipeSize) div CopiersCount, 1]),
     Workers = lists:map(
         fun(_) ->
             {ok, Pid} = couch_replicator_doc_copier:start_link(