From bc95f34a0cadbd4b470883fc61e12d5c448fc1ed Mon Sep 17 00:00:00 2001 From: Filipe David Borba Manana Date: Wed, 17 Nov 2010 11:42:32 +0000 Subject: Replicator DB: added 2 useful log messages. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1035987 13f79535-47bb-0310-9956-ffa450edef68 --- src/couchdb/couch_rep_db_listener.erl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/couchdb') diff --git a/src/couchdb/couch_rep_db_listener.erl b/src/couchdb/couch_rep_db_listener.erl index 926b2987..51b3bf68 100644 --- a/src/couchdb/couch_rep_db_listener.erl +++ b/src/couchdb/couch_rep_db_listener.erl @@ -198,16 +198,20 @@ maybe_start_replication({RepProps} = JsonRepDoc) -> spawn_link(fun() -> start_replication(JsonRepDoc, RepId, UserCtx) end); [{RepId, DocId}] -> ok; - [{RepId, _OtherDocId}] -> + [{RepId, OtherDocId}] -> + ?LOG_INFO("The replication specified by the document `~s` was already" + " triggered by the document `~s`", [DocId, OtherDocId]), couch_rep:update_rep_doc( JsonRepDoc, [{<<"replication_id">>, ?l2b(element(1, RepId))}] ) end. -start_replication(RepDoc, RepId, UserCtx) -> +start_replication({RepProps} = RepDoc, {Base, Ext} = RepId, UserCtx) -> case (catch couch_rep:start_replication(RepDoc, RepId, UserCtx)) of RepPid when is_pid(RepPid) -> + ?LOG_INFO("Document `~s` triggered replication `~s`", + [couch_util:get_value(<<"_id">>, RepProps), Base ++ Ext]), couch_rep:get_result(RepPid, RepId, RepDoc, UserCtx); Error -> couch_rep:update_rep_doc( -- cgit v1.2.3