diff options
| author | Mark Cilia Vincenti <markciliavincenti@gmail.com> | 2024-01-03 16:47:25 +0100 |
|---|---|---|
| committer | Mark Cilia Vincenti <markciliavincenti@gmail.com> | 2024-01-03 16:47:25 +0100 |
| commit | d1677dc680338679f06cc506e97f576d16d022b5 (patch) | |
| tree | d6ac2d46b7e13b59ab98c4b284d0e57d3444d33e /Jellyfin.Api/Helpers/FileStreamResponseHelpers.cs | |
| parent | 9fb67424004166423f5857ca01d0f3b524c27b7a (diff) | |
AsyncKeyedLock migration
Diffstat (limited to 'Jellyfin.Api/Helpers/FileStreamResponseHelpers.cs')
| -rw-r--r-- | Jellyfin.Api/Helpers/FileStreamResponseHelpers.cs | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/Jellyfin.Api/Helpers/FileStreamResponseHelpers.cs b/Jellyfin.Api/Helpers/FileStreamResponseHelpers.cs index 5385979d4..cb178a61d 100644 --- a/Jellyfin.Api/Helpers/FileStreamResponseHelpers.cs +++ b/Jellyfin.Api/Helpers/FileStreamResponseHelpers.cs @@ -93,9 +93,7 @@ public static class FileStreamResponseHelpers return new OkResult(); } - var transcodingLock = transcodeManager.GetTranscodingLock(outputPath); - await transcodingLock.WaitAsync(cancellationTokenSource.Token).ConfigureAwait(false); - try + using (await transcodeManager.LockAsync(outputPath, cancellationTokenSource.Token).ConfigureAwait(false)) { TranscodingJob? job; if (!File.Exists(outputPath)) @@ -117,9 +115,5 @@ public static class FileStreamResponseHelpers var stream = new ProgressiveFileStream(outputPath, job, transcodeManager); return new FileStreamResult(stream, contentType); } - finally - { - transcodingLock.Release(); - } } } |
