Fixed issue

This commit is contained in:
Mark Cilia Vincenti 2024-01-14 13:45:02 +01:00 committed by GitHub
parent e47144e7c7
commit 420ce6a4fa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -903,9 +903,8 @@ namespace MediaBrowser.MediaEncoding.Encoder
using (var processWrapper = new ProcessWrapper(process, this))
{
bool ranToCompletion = false;
await _thumbnailResourcePool.WaitAsync(cancellationToken).ConfigureAwait(false);
try
using (await _thumbnailResourcePool.LockAsync(cancellationToken).ConfigureAwait(false))
{
StartProcess(processWrapper);
@ -959,10 +958,6 @@ namespace MediaBrowser.MediaEncoding.Encoder
StopProcess(processWrapper, 1000);
}
}
finally
{
_thumbnailResourcePool.Release();
}
var exitCode = ranToCompletion ? processWrapper.ExitCode ?? 0 : -1;