summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Shorin <kxepal@apache.org>2015-01-13 03:28:39 +0300
committerAlexander Shorin <kxepal@apache.org>2015-01-13 03:28:39 +0300
commit217503577e23f26dfd2f9cbaa52e9f78aaa3b308 (patch)
tree89768e337a12afedcc04dcf47d77f76d07a7485d
parentc552c665dc6af0ca750ce074c816c4fcb0f05962 (diff)
downloadcouchdb-217503577e23f26dfd2f9cbaa52e9f78aaa3b308.tar.gz
Handle {gen_event_EXIT,{config_listener,ioq},shutdown} message
-rw-r--r--src/ioq.erl8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/ioq.erl b/src/ioq.erl
index 4598c3766..6c01b9c60 100644
--- a/src/ioq.erl
+++ b/src/ioq.erl
@@ -75,7 +75,6 @@ handle_info({Ref, Reply}, State) ->
false ->
{noreply, State, 0}
end;
-
handle_info({'DOWN', Ref, _, _, Reason}, State) ->
case lists:keytake(Ref, #request.ref, State#state.running) of
{value, Request, Remaining} ->
@@ -84,7 +83,12 @@ handle_info({'DOWN', Ref, _, _, Reason}, State) ->
false ->
{noreply, State, 0}
end;
-
+handle_info({gen_event_EXIT, {config_listener, ?MODULE}, _Reason}, State) ->
+ erlang:send_after(5000, self(), restart_config_listener),
+ {noreply, State};
+handle_info(restart_config_listener, State) ->
+ ok = config:listen_for_changes(?MODULE, nil),
+ {noreply, State};
handle_info(timeout, State) ->
{noreply, maybe_submit_request(State)}.