couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fdman...@apache.org
Subject svn commit: r1156384 - /couchdb/branches/1.0.x/src/couchdb/couch_server.erl
Date Wed, 10 Aug 2011 21:58:06 GMT
Author: fdmanana
Date: Wed Aug 10 21:58:06 2011
New Revision: 1156384

URL: http://svn.apache.org/viewvc?rev=1156384&view=rev
Log:
Revert couch_server changes added in revision 1156362

Leaving the tests however since it doesn't hurt.


Modified:
    couchdb/branches/1.0.x/src/couchdb/couch_server.erl

Modified: couchdb/branches/1.0.x/src/couchdb/couch_server.erl
URL: http://svn.apache.org/viewvc/couchdb/branches/1.0.x/src/couchdb/couch_server.erl?rev=1156384&r1=1156383&r2=1156384&view=diff
==============================================================================
--- couchdb/branches/1.0.x/src/couchdb/couch_server.erl (original)
+++ couchdb/branches/1.0.x/src/couchdb/couch_server.erl Wed Aug 10 21:58:06 2011
@@ -308,13 +308,11 @@ handle_call({open, DbName, Options}, {Fr
         {reply, couch_db:open_ref_counted(MainPid, FromPid), Server}
     end;
 handle_call({create, DbName, Options}, From, Server) ->
-    FileName = get_full_filename(Server, ?b2l(DbName)),
-    case file:open(FileName, [read]) of
-    {ok, Fd} ->
-        ok = file:close(Fd),
-        {reply, file_exists, Server};
-    Error ->
-        open_db(DbName, Server, [create | Options], From)
+    case ets:lookup(couch_dbs_by_name, DbName) of
+    [] ->
+        open_db(DbName, Server, [create | Options], From);
+    [_AlreadyRunningDb] ->
+        {reply, file_exists, Server}
     end;
 handle_call({delete, DbName, _Options}, _From, Server) ->
     DbNameList = binary_to_list(DbName),



Mime
View raw message