couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fdman...@apache.org
Subject svn commit: r960229 - /couchdb/trunk/src/couchdb/couch_auth_cache.erl
Date Sat, 03 Jul 2010 15:34:50 GMT
Author: fdmanana
Date: Sat Jul  3 15:34:50 2010
New Revision: 960229

URL: http://svn.apache.org/viewvc?rev=960229&view=rev
Log:
Replacing call couch_httpd_db:couch_doc_open/4 with call to couch_db:open_doc/2.
It's more correct from a design point of view.


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

Modified: couchdb/trunk/src/couchdb/couch_auth_cache.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_auth_cache.erl?rev=960229&r1=960228&r2=960229&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_auth_cache.erl (original)
+++ couchdb/trunk/src/couchdb/couch_auth_cache.erl Sat Jul  3 15:34:50 2010
@@ -392,12 +392,12 @@ ensure_users_db_exists(DbName, Options) 
     end.
 
 ensure_auth_ddoc_exists(Db, DDocId) ->
-    try
-        couch_httpd_db:couch_doc_open(Db, DDocId, nil, [])
-    catch
-    _:_Error ->
+    case couch_db:open_doc(Db, DDocId) of
+    {not_found, _Reason} ->
         {ok, AuthDesign} = auth_design_doc(DDocId),
-        {ok, _Rev} = couch_db:update_doc(Db, AuthDesign, [])
+        {ok, _Rev} = couch_db:update_doc(Db, AuthDesign, []);
+    _ ->
+        ok
     end,
     ok.
 



Mime
View raw message