couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fdman...@apache.org
Subject git commit: Remove no longer necessary call in replicator db
Date Tue, 04 Oct 2011 14:30:08 GMT
Updated Branches:
  refs/heads/1.2.x 76a1fb810 -> 035b40869


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

Branch: refs/heads/1.2.x
Commit: 035b408699018c7605ed64b00f58a3a260a1f553
Parents: 76a1fb8
Author: Filipe David Manana <fdmanana@apache.org>
Authored: Tue Oct 4 15:28:44 2011 -0700
Committer: Filipe David Manana <fdmanana@apache.org>
Committed: Tue Oct 4 15:29:42 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/035b4086/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]}.
 
 


Mime
View raw message