Remove unnecessary async and parameter from ApplicationHost initialization method

This commit is contained in:
Mark Monteiro 2020-04-04 20:40:50 -04:00
parent 5d648bf54f
commit aee6a1b476
3 changed files with 5 additions and 7 deletions

View File

@ -500,7 +500,7 @@ namespace Emby.Server.Implementations
} }
/// <inheritdoc/> /// <inheritdoc/>
public async Task InitAsync(IServiceCollection serviceCollection, IConfiguration startupConfig) public void Init(IServiceCollection serviceCollection)
{ {
HttpPort = ServerConfigurationManager.Configuration.HttpServerPortNumber; HttpPort = ServerConfigurationManager.Configuration.HttpServerPortNumber;
HttpsPort = ServerConfigurationManager.Configuration.HttpsPortNumber; HttpsPort = ServerConfigurationManager.Configuration.HttpsPortNumber;
@ -533,7 +533,7 @@ namespace Emby.Server.Implementations
DiscoverTypes(); DiscoverTypes();
await RegisterServices(serviceCollection, startupConfig).ConfigureAwait(false); RegisterServices(serviceCollection);
} }
public async Task ExecuteWebsocketHandlerAsync(HttpContext context, Func<Task> next) public async Task ExecuteWebsocketHandlerAsync(HttpContext context, Func<Task> next)
@ -566,7 +566,7 @@ namespace Emby.Server.Implementations
/// <summary> /// <summary>
/// Registers services/resources with the service collection that will be available via DI. /// Registers services/resources with the service collection that will be available via DI.
/// </summary> /// </summary>
protected async Task RegisterServices(IServiceCollection serviceCollection, IConfiguration startupConfig) protected void RegisterServices(IServiceCollection serviceCollection)
{ {
var imageEncoderType = SkiaEncoder.IsNativeLibAvailable() var imageEncoderType = SkiaEncoder.IsNativeLibAvailable()
? typeof(SkiaEncoder) ? typeof(SkiaEncoder)

View File

@ -202,7 +202,7 @@ namespace Jellyfin.Server
} }
ServiceCollection serviceCollection = new ServiceCollection(); ServiceCollection serviceCollection = new ServiceCollection();
await appHost.InitAsync(serviceCollection, startupConfig).ConfigureAwait(false); appHost.Init(serviceCollection);
var webHost = CreateWebHostBuilder(appHost, serviceCollection, options, startupConfig, appPaths).Build(); var webHost = CreateWebHostBuilder(appHost, serviceCollection, options, startupConfig, appPaths).Build();

View File

@ -125,9 +125,7 @@ namespace MediaBrowser.Common
/// Initializes this instance. /// Initializes this instance.
/// </summary> /// </summary>
/// <param name="serviceCollection">The service collection.</param> /// <param name="serviceCollection">The service collection.</param>
/// <param name="startupConfig">The configuration to use for initialization.</param> void Init(IServiceCollection serviceCollection);
/// <returns>A task.</returns>
Task InitAsync(IServiceCollection serviceCollection, IConfiguration startupConfig);
/// <summary> /// <summary>
/// Creates the instance. /// Creates the instance.