Skip to content

Commit

Permalink
some improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
sensslen committed Oct 30, 2024
1 parent 10eb713 commit 1dffdd0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/NuGetUtility/Wrapper/HttpClientWrapper/FileDownloader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public async Task DownloadFile(Uri url, string fileNameStem, CancellationToken t
{
return;
}
await Task.Delay((int)Math.Pow(EXPONENTIAL_BACKOFF_WAIT_TIME_MILLISECONDS, i + 1), token);
await Task.Delay(EXPONENTIAL_BACKOFF_WAIT_TIME_MILLISECONDS * ((int)Math.Pow(2, i)), token);
}
}
finally
Expand Down Expand Up @@ -71,7 +71,7 @@ private async Task<bool> TryDownload(string fileNameStem, Uri url, CancellationT
{
extension = "txt";
}
string fileName = fileNameStem + "." + extension;
string fileName = $"{fileNameStem}.{extension}";
#if NETFRAMEWORK
using FileStream file = File.OpenWrite(Path.Combine(_downloadDirectory, fileName));
#else
Expand Down

0 comments on commit 1dffdd0

Please sign in to comment.