diff options
| author | Mark Monteiro <marknr.monteiro@protonmail.com> | 2020-03-21 23:17:30 +0100 |
|---|---|---|
| committer | Mark Monteiro <marknr.monteiro@protonmail.com> | 2020-03-21 23:17:30 +0100 |
| commit | dc140429fe5d6718d516a02ee3951e191f9db621 (patch) | |
| tree | b4416471dc9d8d93254e559d576c72da2d5d6896 /Emby.Server.Implementations/HttpServer/HttpListenerHost.cs | |
| parent | aa546dd36abb688cb3a5d10e589521ebf79ef610 (diff) | |
Do not create unnecessary instances of IService at server startup
Diffstat (limited to 'Emby.Server.Implementations/HttpServer/HttpListenerHost.cs')
| -rw-r--r-- | Emby.Server.Implementations/HttpServer/HttpListenerHost.cs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs b/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs index 655130fcf..a3b61b98b 100644 --- a/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs +++ b/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs @@ -594,17 +594,16 @@ namespace Emby.Server.Implementations.HttpServer /// <summary> /// Adds the rest handlers. /// </summary> - /// <param name="services">The services.</param> - /// <param name="listeners"></param> - /// <param name="urlPrefixes"></param> - public void Init(IEnumerable<IService> services, IEnumerable<IWebSocketListener> listeners, IEnumerable<string> urlPrefixes) + /// <param name="serviceTypes">The service types to register with the <see cref="ServiceController"/>.</param> + /// <param name="listeners">The web socket listeners.</param> + /// <param name="urlPrefixes">The URL prefixes. See <see cref="UrlPrefixes"/>.</param> + public void Init(IEnumerable<Type> serviceTypes, IEnumerable<IWebSocketListener> listeners, IEnumerable<string> urlPrefixes) { _webSocketListeners = listeners.ToArray(); UrlPrefixes = urlPrefixes.ToArray(); ServiceController = new ServiceController(); - var types = services.Select(r => r.GetType()); - ServiceController.Init(this, types); + ServiceController.Init(this, serviceTypes); ResponseFilters = new Action<IRequest, HttpResponse, object>[] { |
