From 3df8cda110a952ca529740f2b985c624c036a5f0 Mon Sep 17 00:00:00 2001 From: Bond-009 Date: Wed, 13 Feb 2019 16:47:12 +0100 Subject: [PATCH] ConfigureAwait --- Jellyfin.Server/Program.cs | 8 ++++---- Jellyfin.Server/SocketSharp/WebSocketSharpListener.cs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Jellyfin.Server/Program.cs b/Jellyfin.Server/Program.cs index 2c177290eb..6dfabc3644 100644 --- a/Jellyfin.Server/Program.cs +++ b/Jellyfin.Server/Program.cs @@ -63,7 +63,7 @@ namespace Jellyfin.Server // $JELLYFIN_LOG_DIR needs to be set for the logger configuration manager Environment.SetEnvironmentVariable("JELLYFIN_LOG_DIR", appPaths.LogDirectoryPath); - await CreateLogger(appPaths); + await CreateLogger(appPaths).ConfigureAwait(false); _logger = _loggerFactory.CreateLogger("Main"); AppDomain.CurrentDomain.UnhandledException += (sender, e) @@ -115,18 +115,18 @@ namespace Jellyfin.Server new NullImageEncoder(), new NetworkManager(_loggerFactory, environmentInfo))) { - await appHost.Init(new ServiceCollection()); + await appHost.Init(new ServiceCollection()).ConfigureAwait(false); appHost.ImageProcessor.ImageEncoder = GetImageEncoder(fileSystem, appPaths, appHost.LocalizationManager); - await appHost.RunStartupTasks(); + await appHost.RunStartupTasks().ConfigureAwait(false); // TODO: read input for a stop command try { // Block main thread until shutdown - await Task.Delay(-1, _tokenSource.Token); + await Task.Delay(-1, _tokenSource.Token).ConfigureAwait(false); } catch (TaskCanceledException) { diff --git a/Jellyfin.Server/SocketSharp/WebSocketSharpListener.cs b/Jellyfin.Server/SocketSharp/WebSocketSharpListener.cs index 12591a1cde..a0ffd1ccf4 100644 --- a/Jellyfin.Server/SocketSharp/WebSocketSharpListener.cs +++ b/Jellyfin.Server/SocketSharp/WebSocketSharpListener.cs @@ -83,7 +83,7 @@ namespace Jellyfin.Server.SocketSharp private void ProcessContext(HttpListenerContext context) { - _ = Task.Run(async () => await InitTask(context, _disposeCancellationToken)); + _ = Task.Run(async () => await InitTask(context, _disposeCancellationToken).ConfigureAwait(false)); } private static void LogRequest(ILogger logger, HttpListenerRequest request)