diff --git a/src/NuGetUtility/Wrapper/HttpClientWrapper/FileDownloader.cs b/src/NuGetUtility/Wrapper/HttpClientWrapper/FileDownloader.cs index e8d1fd7..6a038e7 100644 --- a/src/NuGetUtility/Wrapper/HttpClientWrapper/FileDownloader.cs +++ b/src/NuGetUtility/Wrapper/HttpClientWrapper/FileDownloader.cs @@ -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 @@ -71,7 +71,7 @@ private async Task 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