summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Newson <rnewson@apache.org>2014-09-05 18:22:44 +0100
committerRobert Newson <rnewson@apache.org>2014-09-05 18:22:44 +0100
commitc7f9ad1c0f77b601aa456e62c963793d517c1026 (patch)
treedc8792f75009affa0ea2d5a10e504737cca2b972
parent04aea732058c5f0b7081b1fa444dbf4b3761cd02 (diff)
downloadcouchdb-c7f9ad1c0f77b601aa456e62c963793d517c1026.tar.gz
Fallback to direct I/O if ioq is not running
-rw-r--r--src/ioq.erl7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/ioq.erl b/src/ioq.erl
index 4983b73d6..b761a0b41 100644
--- a/src/ioq.erl
+++ b/src/ioq.erl
@@ -37,7 +37,12 @@ start_link() ->
call(Fd, Msg, Priority) ->
Request = #request{fd=Fd, msg=Msg, priority=Priority, from=self()},
- gen_server:call(?MODULE, Request, infinity).
+ try
+ gen_server:call(?MODULE, Request, infinity)
+ catch
+ exit:{noproc,_} ->
+ gen_server:call(Fd, Msg, infinity)
+ end.
init(_) ->
Ratio = list_to_float(config:get("ioq", "ratio", "0.01")),