aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Server/Program.cs
diff options
context:
space:
mode:
authorBond_009 <bond.009@outlook.com>2021-06-12 22:20:35 +0200
committerBond_009 <bond.009@outlook.com>2021-09-02 14:02:04 +0200
commite3dac4fda2033801085eb7086a3a534c473a00a0 (patch)
tree01de832fd8bf4d40717e55d8def82c308c1d30d8 /Jellyfin.Server/Program.cs
parent620dd9497025761f208fc3ce7b78caf8c2f7835f (diff)
Use async FileStreams where it makes sense
Diffstat (limited to 'Jellyfin.Server/Program.cs')
-rw-r--r--Jellyfin.Server/Program.cs3
1 files changed, 2 insertions, 1 deletions
diff --git a/Jellyfin.Server/Program.cs b/Jellyfin.Server/Program.cs
index 7018d537f..6e87c8939 100644
--- a/Jellyfin.Server/Program.cs
+++ b/Jellyfin.Server/Program.cs
@@ -15,6 +15,7 @@ using Jellyfin.Server.Implementations;
using MediaBrowser.Common.Configuration;
using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Extensions;
+using MediaBrowser.Model.IO;
using Microsoft.AspNetCore.Hosting;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
@@ -546,7 +547,7 @@ namespace Jellyfin.Server
?? throw new InvalidOperationException($"Invalid resource path: '{ResourcePath}'");
// Copy the resource contents to the expected file path for the config file
- await using Stream dst = File.Open(configPath, FileMode.CreateNew);
+ await using Stream dst = new FileStream(configPath, FileMode.CreateNew, FileAccess.Write, FileShare.None, IODefaults.FileStreamBufferSize, AsyncFile.UseAsyncIO);
await resource.CopyToAsync(dst).ConfigureAwait(false);
}