You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ch...@apache.org on 2019/03/13 19:17:35 UTC
[couchdb-ioq] 06/21: Handle {gen_event_EXIT, {config_listener, ioq},
shutdown} message
This is an automated email from the ASF dual-hosted git repository.
chewbranca pushed a commit to branch ioq-per-shard-or-user
in repository https://gitbox.apache.org/repos/asf/couchdb-ioq.git
commit 217503577e23f26dfd2f9cbaa52e9f78aaa3b308
Author: Alexander Shorin <kx...@apache.org>
AuthorDate: Tue Jan 13 03:28:39 2015 +0300
Handle {gen_event_EXIT,{config_listener,ioq},shutdown} message
---
src/ioq.erl | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/ioq.erl b/src/ioq.erl
index 4598c37..6c01b9c 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)}.