Github user rnewson commented on a diff in the pull request:
https://github.com/apache/couchdb-chttpd/pull/77#discussion_r40687622
--- Diff: src/chttpd_sup.erl ---
@@ -57,10 +54,8 @@ lru_opts() ->
[]
end.
-auth_cache_handler() ->
- case application:get_env(chttpd, auth_cache) of
- {ok, Module} ->
- Module;
- _ ->
- chttpd_auth_cache
- end.
+add_auth_cache_if_missing(Children) ->
--- End diff --
this is in case `couch_epi:register_service(chttpd_epi)` returns a
replacement but it's ad-hoc. Would it a better api to pass the pre-epi children
in and then use the return value instead? that way chttpd_epi plugins could
remove unwanted children cleanly. something like;
```
Children0 = [?CHILD(auth_cache_handler(), worker), and others...],
Children1 = couch_epi:register_service(chttpd_epi, Children0),
{ok, {{one_for_one, 3, 10}, Children1}.
```
register_service would modify the input list, replacing the auth_cache
childspec.
---
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 [email protected] or file a JIRA ticket
with INFRA.
---