diff options
author | Filipe David Manana <fdmanana@apache.org> | 2011-10-04 15:28:44 -0700 |
---|---|---|
committer | Filipe David Manana <fdmanana@apache.org> | 2011-10-04 15:28:44 -0700 |
commit | fb5d36fd55bd7c3d713adb80eeb8409873625090 (patch) | |
tree | da3681b13a97e85e6e37016ee363dd10bcae6693 | |
parent | d480f654f8a12ccd4ee0c0640290304d2ae0b054 (diff) | |
download | couchdb-fb5d36fd55bd7c3d713adb80eeb8409873625090.tar.gz |
Remove no longer necessary call in replicator db
-rw-r--r-- | src/couchdb/couch_replication_manager.erl | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/couchdb/couch_replication_manager.erl b/src/couchdb/couch_replication_manager.erl index b567c0bfe..58857326b 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]}. |