You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ko...@apache.org on 2011/10/26 20:05:33 UTC

[19/50] git commit: Remove no longer necessary call in replicator db

Remove no longer necessary call in replicator db


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

Branch: refs/heads/1319-large-headers-are-corrupted
Commit: fb5d36fd55bd7c3d713adb80eeb8409873625090
Parents: d480f65
Author: Filipe David Manana <fd...@apache.org>
Authored: Tue Oct 4 15:28:44 2011 -0700
Committer: Filipe David Manana <fd...@apache.org>
Committed: Tue Oct 4 15:28:44 2011 -0700

----------------------------------------------------------------------
 src/couchdb/couch_replication_manager.erl |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/fb5d36fd/src/couchdb/couch_replication_manager.erl
----------------------------------------------------------------------
diff --git a/src/couchdb/couch_replication_manager.erl b/src/couchdb/couch_replication_manager.erl
index b567c0b..5885732 100644
--- a/src/couchdb/couch_replication_manager.erl
+++ b/src/couchdb/couch_replication_manager.erl
@@ -363,8 +363,7 @@ maybe_start_replication(State, DocId, RepDoc) ->
         true = ets:insert(?DOC_TO_REP, {DocId, RepId}),
         ?LOG_INFO("Attempting to start replication `~s` (document `~s`).",
             [pp_rep_id(RepId), DocId]),
-        Server = self(),
-        Pid = spawn_link(fun() -> start_replication(Server, Rep, 0) end),
+        Pid = spawn_link(fun() -> start_replication(Rep, 0) end),
         State#state{rep_start_pids = [Pid | State#state.rep_start_pids]};
     #rep_state{rep = #rep{doc_id = DocId}} ->
         State;
@@ -402,11 +401,11 @@ maybe_tag_rep_doc(DocId, {RepProps}, RepId) ->
     end.
 
 
-start_replication(Server, #rep{id = RepId} = Rep, Wait) ->
+start_replication(Rep, Wait) ->
     ok = timer:sleep(Wait * 1000),
     case (catch couch_replicator:async_replicate(Rep)) of
     {ok, _} ->
-        ok = gen_server:call(Server, {rep_started, RepId}, infinity);
+        ok;
     Error ->
         replication_error(Rep, Error)
     end.
@@ -470,8 +469,7 @@ maybe_retry_replication(RepState, Error, State) ->
     ?LOG_ERROR("Error in replication `~s` (triggered by document `~s`): ~s"
         "~nRestarting replication in ~p seconds.",
         [pp_rep_id(RepId), DocId, to_binary(error_reason(Error)), Wait]),
-    Server = self(),
-    Pid = spawn_link(fun() -> start_replication(Server, Rep, Wait) end),
+    Pid = spawn_link(fun() -> start_replication(Rep, Wait) end),
     State#state{rep_start_pids = [Pid | State#state.rep_start_pids]}.