summaryrefslogtreecommitdiff
path: root/src/couchdb/couch_db.erl
diff options
context:
space:
mode:
authorJohn Christopher Anderson <jchris@apache.org>2010-02-24 15:37:16 +0000
committerJohn Christopher Anderson <jchris@apache.org>2010-02-24 15:37:16 +0000
commit838208cde9cac38299ae7ef108c9c468c50c28f7 (patch)
tree5dee6ec1a3c3d5031ac386e85de73c4cd9e79998 /src/couchdb/couch_db.erl
parentadf10a62ec14da5a354f03fed055f14d292961e8 (diff)
replicator and view generator can skip check_is_reader when opening database files
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@915827 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/couch_db.erl')
-rw-r--r--src/couchdb/couch_db.erl9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/couchdb/couch_db.erl b/src/couchdb/couch_db.erl
index 6d5da15b..e5635f55 100644
--- a/src/couchdb/couch_db.erl
+++ b/src/couchdb/couch_db.erl
@@ -13,7 +13,7 @@
-module(couch_db).
-behaviour(gen_server).
--export([open/2,close/1,create/2,start_compact/1,get_db_info/1,get_design_docs/1]).
+-export([open/2,open_int/2,close/1,create/2,start_compact/1,get_db_info/1,get_design_docs/1]).
-export([open_ref_counted/2,is_idle/1,monitor/1,count_changes_since/2]).
-export([update_doc/3,update_doc/4,update_docs/4,update_docs/2,update_docs/3,delete_doc/3]).
-export([get_doc_info/2,open_doc/2,open_doc/3,open_doc_revs/4]).
@@ -64,6 +64,13 @@ open_db_file(Filepath, Options) ->
create(DbName, Options) ->
couch_server:create(DbName, Options).
+% this is for opening a database for internal purposes like the replicator
+% or the view indexer. it never throws a reader error.
+open_int(DbName, Options) ->
+ couch_server:open(DbName, Options).
+
+% this should be called anytime an http request opens the database.
+% it ensures that the http userCtx is a valid reader
open(DbName, Options) ->
case couch_server:open(DbName, Options) of
{ok, Db} ->