couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fdman...@apache.org
Subject svn commit: r1035987 - /couchdb/trunk/src/couchdb/couch_rep_db_listener.erl
Date Wed, 17 Nov 2010 11:42:32 GMT
Author: fdmanana
Date: Wed Nov 17 11:42:32 2010
New Revision: 1035987

URL: http://svn.apache.org/viewvc?rev=1035987&view=rev
Log:
Replicator DB: added 2 useful log messages.

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

Modified: couchdb/trunk/src/couchdb/couch_rep_db_listener.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_rep_db_listener.erl?rev=1035987&r1=1035986&r2=1035987&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_rep_db_listener.erl (original)
+++ couchdb/trunk/src/couchdb/couch_rep_db_listener.erl Wed Nov 17 11:42:32 2010
@@ -198,16 +198,20 @@ maybe_start_replication({RepProps} = Jso
         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(



Mime
View raw message