Check for cancellation after semaphore completion

It doesn’t look like anything actually calls Cancel() on this CancellationTokenSource, but if something ever does we’d want this to work properly.
This commit is contained in:
Yaakov committed 2017-09-09 23:57:02 +03:00
1 parent 1e3ca8f016
commit 6105a99e72
1 file changed
+2 -1
+2 -1
View File
@@ -695,10 +695,11 @@ namespace DepotDownloader
var task = Task.Run( async () =>
{
cts.Token.ThrowIfCancellationRequested();
try
{
await semaphore.WaitAsync().ConfigureAwait( false );
cts.Token.ThrowIfCancellationRequested();
string fileFinalPath = Path.Combine( depot.installDir, file.FileName );
string fileStagingPath = Path.Combine( stagingDir, file.FileName );