Github user kxepal commented on a diff in the pull request: https://github.com/apache/couchdb-couch-index/pull/18#discussion_r75572589 --- Diff: src/couch_index.erl --- @@ -344,25 +340,19 @@ handle_info({'DOWN', _, _, _Pid, _}, #st{mod=Mod, idx_state=IdxState}=State) -> Args = [Mod:get(db_name, IdxState), Mod:get(idx_name, IdxState)], couch_log:info("Index shutdown by monitor notice for db: ~s idx: ~s", Args), catch send_all(State#st.waiters, shutdown), - {stop, normal, State#st{waiters=[]}}. - + {stop, normal, State#st{waiters=[]}}; +handle_info({config_change, "query_server_config", "commit_freq", NewDelay, _}, State) -> + handle_cast({config_change, NewDelay}, State); +handle_info({gen_event_EXIT, _Handler, _Reason}, State) -> + erlang:send_after(?RELISTEN_DELAY, self(), restart_config_listener), + {noreply, State}; +handle_info(restart_config_listener, State) -> + ok = config:subscribe_for_changes([{"query_server_config", "commit_freq"}]), --- End diff -- Feels like if we have a single place where we do subscribe for certain config keys will save us from mistakes, when we forgot to update a second `config:subscribe_for_changes` call. Or at least if we'll use `define` for what we subscribe.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---