From 1dffdd0d8aae17690468a55a2c20be8e5c62fe2e Mon Sep 17 00:00:00 2001 From: Simon Ensslen Date: Wed, 30 Oct 2024 18:12:47 +0100 Subject: [PATCH] some improvements --- src/NuGetUtility/Wrapper/HttpClientWrapper/FileDownloader.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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