aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Server/Program.cs
diff options
context:
space:
mode:
authorCody Robibero <cody@robibe.ro>2022-02-06 15:25:48 -0700
committerGitHub <noreply@github.com>2022-02-06 15:25:48 -0700
commitb6489e73abd82738d7cb7aa2a5921db865dcd9d9 (patch)
treebb7ecba76748a1725f7fd2234ae88a2a634b7bde /Jellyfin.Server/Program.cs
parent10d52d16a8c4af67e0aa05e9a5f8b63fdf264e53 (diff)
parente7be01d7a5b7d2e93d8ee0fddb812c2ce048db50 (diff)
Merge pull request #7241 from Bond-009/async5
Diffstat (limited to 'Jellyfin.Server/Program.cs')
-rw-r--r--Jellyfin.Server/Program.cs13
1 files changed, 8 insertions, 5 deletions
diff --git a/Jellyfin.Server/Program.cs b/Jellyfin.Server/Program.cs
index 05c59ebfb..ce11c63f9 100644
--- a/Jellyfin.Server/Program.cs
+++ b/Jellyfin.Server/Program.cs
@@ -549,12 +549,15 @@ namespace Jellyfin.Server
// Get a stream of the resource contents
// NOTE: The .csproj name is used instead of the assembly name in the resource path
const string ResourcePath = "Jellyfin.Server.Resources.Configuration.logging.json";
- await using Stream resource = typeof(Program).Assembly.GetManifestResourceStream(ResourcePath)
+ Stream resource = typeof(Program).Assembly.GetManifestResourceStream(ResourcePath)
?? throw new InvalidOperationException($"Invalid resource path: '{ResourcePath}'");
-
- // Copy the resource contents to the expected file path for the config file
- await using Stream dst = new FileStream(configPath, FileMode.CreateNew, FileAccess.Write, FileShare.None, IODefaults.FileStreamBufferSize, FileOptions.Asynchronous);
- await resource.CopyToAsync(dst).ConfigureAwait(false);
+ Stream dst = new FileStream(configPath, FileMode.CreateNew, FileAccess.Write, FileShare.None, IODefaults.FileStreamBufferSize, FileOptions.Asynchronous);
+ await using (resource.ConfigureAwait(false))
+ await using (dst.ConfigureAwait(false))
+ {
+ // Copy the resource contents to the expected file path for the config file
+ await resource.CopyToAsync(dst).ConfigureAwait(false);
+ }
}
/// <summary>