ConfigureAwait

This commit is contained in:
Bond-009 2019-02-13 16:47:12 +01:00
parent 43cf11aa35
commit 3df8cda110
2 changed files with 5 additions and 5 deletions

View File

@ -63,7 +63,7 @@ namespace Jellyfin.Server
// $JELLYFIN_LOG_DIR needs to be set for the logger configuration manager // $JELLYFIN_LOG_DIR needs to be set for the logger configuration manager
Environment.SetEnvironmentVariable("JELLYFIN_LOG_DIR", appPaths.LogDirectoryPath); Environment.SetEnvironmentVariable("JELLYFIN_LOG_DIR", appPaths.LogDirectoryPath);
await CreateLogger(appPaths); await CreateLogger(appPaths).ConfigureAwait(false);
_logger = _loggerFactory.CreateLogger("Main"); _logger = _loggerFactory.CreateLogger("Main");
AppDomain.CurrentDomain.UnhandledException += (sender, e) AppDomain.CurrentDomain.UnhandledException += (sender, e)
@ -115,18 +115,18 @@ namespace Jellyfin.Server
new NullImageEncoder(), new NullImageEncoder(),
new NetworkManager(_loggerFactory, environmentInfo))) new NetworkManager(_loggerFactory, environmentInfo)))
{ {
await appHost.Init(new ServiceCollection()); await appHost.Init(new ServiceCollection()).ConfigureAwait(false);
appHost.ImageProcessor.ImageEncoder = GetImageEncoder(fileSystem, appPaths, appHost.LocalizationManager); appHost.ImageProcessor.ImageEncoder = GetImageEncoder(fileSystem, appPaths, appHost.LocalizationManager);
await appHost.RunStartupTasks(); await appHost.RunStartupTasks().ConfigureAwait(false);
// TODO: read input for a stop command // TODO: read input for a stop command
try try
{ {
// Block main thread until shutdown // Block main thread until shutdown
await Task.Delay(-1, _tokenSource.Token); await Task.Delay(-1, _tokenSource.Token).ConfigureAwait(false);
} }
catch (TaskCanceledException) catch (TaskCanceledException)
{ {

View File

@ -83,7 +83,7 @@ namespace Jellyfin.Server.SocketSharp
private void ProcessContext(HttpListenerContext context) 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) private static void LogRequest(ILogger logger, HttpListenerRequest request)