Skip to content

Commit

Permalink
pragma warning disable 4014
Browse files Browse the repository at this point in the history
  • Loading branch information
rogerfar committed Jul 31, 2021
1 parent 05e565f commit 1f754da
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 19 deletions.
28 changes: 15 additions & 13 deletions server/RdtClient.Service/Services/DownloadClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,20 +56,22 @@ public async Task Start(DbSettings settings)

var uri = new Uri(_download.Link);

#pragma warning disable 4014
Task.Run(async delegate
{
switch (settings.DownloadClient)
{
case "Simple":
await DownloadSimple(uri, filePath);
break;
case "MultiPart":
await DownloadMultiPart(filePath, settings);
break;
default:
throw new Exception($"Unknown download client {settings.DownloadClient}");
}
});
#pragma warning restore 4014
{
switch (settings.DownloadClient)
{
case "Simple":
await DownloadSimple(uri, filePath);
break;
case "MultiPart":
await DownloadMultiPart(filePath, settings);
break;
default:
throw new Exception($"Unknown download client {settings.DownloadClient}");
}
});
}
catch (Exception ex)
{
Expand Down
14 changes: 8 additions & 6 deletions server/RdtClient.Service/Services/UnpackClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,15 @@ public async Task Start()
throw new Exception("Invalid download path");
}

#pragma warning disable 4014
Task.Run(async delegate
{
if (!_cancelled)
{
await Unpack(filePath);
}
});
#pragma warning restore 4014
{
if (!_cancelled)
{
await Unpack(filePath);
}
});
}
catch (Exception ex)
{
Expand Down

0 comments on commit 1f754da

Please sign in to comment.