The Free Software Media System - Server Backend & API
Use the correct method to synchronously wait for tasks to complete
Mark Monteiro7e467f9faa18
diff --git a/tests/MediaBrowser.Api.Tests/JellyfinApplicationFactory.cs b/tests/MediaBrowser.Api.Tests/JellyfinApplicationFactory.csindex 09821d7286..5300d36610 100644--- a/tests/MediaBrowser.Api.Tests/JellyfinApplicationFactory.cs+++ b/tests/MediaBrowser.Api.Tests/JellyfinApplicationFactory.cs@@ -65,7 +65,7 @@ namespace MediaBrowser.Api.Tests// Create the logging config file// TODO: We shouldn't need to do this since we are only logging to console- Program.InitLoggingConfigFile(appPaths).Wait();+ Program.InitLoggingConfigFile(appPaths).GetAwaiter().GetResult();// Create a copy of the application configuration to use for startupvar startupConfig = Program.CreateAppConfiguration(commandLineOpts, appPaths);@@ -95,8 +95,8 @@ namespace MediaBrowser.Api.Tests// Finish initializing the app hostvar appHost = (CoreAppHost)testServer.Services.GetRequiredService<IApplicationHost>();appHost.ServiceProvider = testServer.Services;- appHost.InitializeServices().Wait();- appHost.RunStartupTasksAsync().Wait();+ appHost.InitializeServices().GetAwaiter().GetResult();+ appHost.RunStartupTasksAsync().GetAwaiter().GetResult();return testServer;}