From 11af04ba67499a5aa3e85076b223c5ae8a9b500b Mon Sep 17 00:00:00 2001 From: Adam Kocoloski Date: Fri, 31 Dec 2010 16:38:28 -0500 Subject: Allow client to specify a timeout when opening a DB --- apps/couch/src/couch_server.erl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'apps/couch/src') diff --git a/apps/couch/src/couch_server.erl b/apps/couch/src/couch_server.erl index a08da475..0624e71f 100644 --- a/apps/couch/src/couch_server.erl +++ b/apps/couch/src/couch_server.erl @@ -50,7 +50,8 @@ open(DbName, Options) -> ets:insert(couch_lru, {DbName, now()}), {ok, Db#db{user_ctx=Ctx, fd_monitor=erlang:monitor(process,Fd)}}; _ -> - case gen_server:call(couch_server, {open, DbName, Options}, infinity) of + Timeout = couch_util:get_value(timeout, Options, infinity), + case gen_server:call(couch_server, {open, DbName, Options}, Timeout) of {ok, #db{fd=Fd} = Db} -> ets:insert(couch_lru, {DbName, now()}), {ok, Db#db{user_ctx=Ctx, fd_monitor=erlang:monitor(process,Fd)}}; -- cgit v1.2.3