summaryrefslogtreecommitdiff
path: root/src/couchdb/couch_server.erl
diff options
context:
space:
mode:
authorFilipe David Borba Manana <fdmanana@apache.org>2011-08-10 22:01:33 +0000
committerFilipe David Borba Manana <fdmanana@apache.org>2011-08-10 22:01:33 +0000
commitf269c49f1d1172fc390f6d54bb79d4841f15adee (patch)
treec453fdc51ce0335f72a0fe0a80402b7f632d1e01 /src/couchdb/couch_server.erl
parent0ac7f70c85f3be8fc65d814473b9a5a5a0aed0f7 (diff)
Revert couch_server changes added in revision 1156361
Leaving the tests however since it doesn't hurt. git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1156385 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/couch_server.erl')
-rw-r--r--src/couchdb/couch_server.erl12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/couchdb/couch_server.erl b/src/couchdb/couch_server.erl
index b9503d2f..7870d69e 100644
--- a/src/couchdb/couch_server.erl
+++ b/src/couchdb/couch_server.erl
@@ -314,13 +314,11 @@ handle_call({open, DbName, Options}, {FromPid,_}=From, Server) ->
{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),