diff options
Diffstat (limited to 'src/couch/src/couch_secondary_sup.erl')
-rw-r--r-- | src/couch/src/couch_secondary_sup.erl | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/couch/src/couch_secondary_sup.erl b/src/couch/src/couch_secondary_sup.erl index a328c170e..cfe38bbd4 100644 --- a/src/couch/src/couch_secondary_sup.erl +++ b/src/couch/src/couch_secondary_sup.erl @@ -22,12 +22,12 @@ init([]) -> {couch_plugin_event, {gen_event, start_link, [{local, couch_plugin}]}, permanent, brutal_kill, worker, dynamic} ], - Daemons = [ - {index_server, {couch_index_server, start_link, []}}, - {query_servers, {couch_proc_manager, start_link, []}}, - {vhosts, {couch_httpd_vhost, start_link, []}}, - {uuids, {couch_uuids, start, []}} - ], + Daemons = + [ + {query_servers, {couch_proc_manager, start_link, []}}, + {vhosts, {couch_httpd_vhost, start_link, []}}, + {uuids, {couch_uuids, start, []}} + ] ++ couch_index_servers(), MaybeHttp = case http_enabled() of @@ -69,3 +69,11 @@ https_enabled() -> LegacySSLEnabled = LegacySSL =:= "{chttpd, start_link, [https]}", SSLEnabled orelse LegacySSLEnabled. + +couch_index_servers() -> + N = couch_index_server:num_servers(), + [couch_index_server(I) || I <- lists:seq(1, N)]. + +couch_index_server(N) -> + Name = couch_index_server:server_name(N), + {Name, {couch_index_server, start_link, [N]}}. |