move check for cancellation of download token outside wait

This commit is contained in:
rootdarkarchon
2023-03-08 23:56:02 +01:00
parent 21fd54e38d
commit 0824ba434b

View File

@@ -396,9 +396,10 @@ public class CachedPlayer : MediatorSubscriberBase, IDisposable
// block until current application is done
_logger.LogDebug("Waiting for current data application (Id: {id}) to finish", _applicationId);
await Task.Delay(250).ConfigureAwait(false);
if (downloadToken.IsCancellationRequested) return;
}
if (downloadToken.IsCancellationRequested) return;
_applicationTask = Task.Run(async () =>
{
_applicationId = Guid.NewGuid();