couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fdman...@apache.org
Subject svn commit: r992996 - in /couchdb/branches/new_replicator/src/couchdb: couch_api_wrap.erl couch_replicate.erl
Date Mon, 06 Sep 2010 11:06:44 GMT
Author: fdmanana
Date: Mon Sep  6 11:06:44 2010
New Revision: 992996

URL: http://svn.apache.org/viewvc?rev=992996&view=rev
Log:
New replicator: avoiding occasional failure on list_to_existing_atom when getting a DB's info.

Modified:
    couchdb/branches/new_replicator/src/couchdb/couch_api_wrap.erl
    couchdb/branches/new_replicator/src/couchdb/couch_replicate.erl

Modified: couchdb/branches/new_replicator/src/couchdb/couch_api_wrap.erl
URL: http://svn.apache.org/viewvc/couchdb/branches/new_replicator/src/couchdb/couch_api_wrap.erl?rev=992996&r1=992995&r2=992996&view=diff
==============================================================================
--- couchdb/branches/new_replicator/src/couchdb/couch_api_wrap.erl (original)
+++ couchdb/branches/new_replicator/src/couchdb/couch_api_wrap.erl Mon Sep  6 11:06:44 2010
@@ -116,10 +116,11 @@ db_close(DbName) ->
 get_db_info(#httpdb{} = Db) ->
     send_req(Db, [],
         fun(200, _, {Props}) ->
-            {ok, [{couch_util:to_existing_atom(K), V} || {K, V} <- Props]}
+            {ok, Props}
         end);
 get_db_info(Db) ->
-    couch_db:get_db_info(Db).
+    {ok, Info} = couch_db:get_db_info(Db),
+    {ok, [{couch_util:to_binary(K), V} || {K, V} <- Info]}.
 
 
 update_doc(Db, Doc, Options) ->

Modified: couchdb/branches/new_replicator/src/couchdb/couch_replicate.erl
URL: http://svn.apache.org/viewvc/couchdb/branches/new_replicator/src/couchdb/couch_replicate.erl?rev=992996&r1=992995&r2=992996&view=diff
==============================================================================
--- couchdb/branches/new_replicator/src/couchdb/couch_replicate.erl (original)
+++ couchdb/branches/new_replicator/src/couchdb/couch_replicate.erl Mon Sep  6 11:06:44 2010
@@ -127,7 +127,7 @@ last_seq(DbName) ->
         DbName, [{user_ctx, #user_ctx{roles = [<<"_admin">>]}}]),
     {ok, DbInfo} = couch_api_wrap:get_db_info(Db),
     couch_api_wrap:db_close(Db),
-    get_value(update_seq, DbInfo).
+    get_value(<<"update_seq">>, DbInfo).
 
 
 start_replication(#rep{id = {BaseId, Extension}} = Rep) ->
@@ -508,8 +508,8 @@ init_state(Rep) ->
         source_log = SourceLog,
         target_log = TargetLog,
         rep_starttime = httpd_util:rfc1123_date(),
-        src_starttime = get_value(instance_start_time, SourceInfo),
-        tgt_starttime = get_value(instance_start_time, TargetInfo)
+        src_starttime = get_value(<<"instance_start_time">>, SourceInfo),
+        tgt_starttime = get_value(<<"instance_start_time">>, TargetInfo)
     },
     State#rep_state{timer = start_timer(State)}.
 



Mime
View raw message