Skip to content
Permalink
Browse files
Fallback to direct I/O if ioq is not running
  • Loading branch information
rnewson committed Sep 5, 2014
1 parent 04aea73 commit c7f9ad1c0f77b601aa456e62c963793d517c1026
Showing 1 changed file with 6 additions and 1 deletion.
@@ -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")),

0 comments on commit c7f9ad1

Please sign in to comment.