couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kxe...@apache.org
Subject couchdb-ioq git commit: Handle {gen_event_EXIT, {config_listener, ioq}, shutdown} message
Date Tue, 13 Jan 2015 00:31:12 GMT
Repository: couchdb-ioq
Updated Branches:
  refs/heads/master c552c665d -> 217503577


Handle {gen_event_EXIT,{config_listener,ioq},shutdown} message


Project: http://git-wip-us.apache.org/repos/asf/couchdb-ioq/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-ioq/commit/21750357
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-ioq/tree/21750357
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-ioq/diff/21750357

Branch: refs/heads/master
Commit: 217503577e23f26dfd2f9cbaa52e9f78aaa3b308
Parents: c552c66
Author: Alexander Shorin <kxepal@apache.org>
Authored: Tue Jan 13 03:28:39 2015 +0300
Committer: Alexander Shorin <kxepal@apache.org>
Committed: Tue Jan 13 03:28:39 2015 +0300

----------------------------------------------------------------------
 src/ioq.erl | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-ioq/blob/21750357/src/ioq.erl
----------------------------------------------------------------------
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)}.
 


Mime
View raw message