Skip to content

Commit 1451942

Browse files
authored
Merge branch 'main' into repo-assist/fix-issue-1251-http-response-default-utf8-rebase-2026-04-14-281889ff768f93b1
2 parents c00e94e + 4abfd83 commit 1451942

4 files changed

Lines changed: 22 additions & 11 deletions

File tree

.github/workflows/repo-assist.lock.yml

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

paket.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ NUGET
2424
NETStandard.Library.NETFramework (2.0.0-preview2-25405-01)
2525
GITHUB
2626
remote: fsprojects/FSharp.TypeProviders.SDK
27-
src/ProvidedTypes.fs (ce34c1cc71096857b8342f1dedf93391addc9df6)
28-
src/ProvidedTypes.fsi (ce34c1cc71096857b8342f1dedf93391addc9df6)
29-
tests/ProvidedTypesTesting.fs (ce34c1cc71096857b8342f1dedf93391addc9df6)
27+
src/ProvidedTypes.fs (75ac6119896431f6573bfcfb663bac2fe3d3df63)
28+
src/ProvidedTypes.fsi (75ac6119896431f6573bfcfb663bac2fe3d3df63)
29+
tests/ProvidedTypesTesting.fs (75ac6119896431f6573bfcfb663bac2fe3d3df63)
3030
GROUP Benchmarks
3131
RESTRICTION: == net8.0
3232
NUGET

src/FSharp.Data.Runtime.Utilities/Caching.fs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,15 @@ let createInMemoryCache (expiration: TimeSpan) =
5555
/// Get hash code of a string - used to determine cache file
5656
let private hashString (plainText: string) =
5757
let plainTextBytes = Encoding.UTF8.GetBytes(plainText)
58-
let hashBytes = SHA1.Create().ComputeHash(plainTextBytes)
58+
59+
let hashBytes =
60+
#if NET5_0_OR_GREATER
61+
SHA1.HashData(plainTextBytes)
62+
#else
63+
use sha1 = SHA1.Create()
64+
sha1.ComputeHash(plainTextBytes)
65+
#endif
66+
5967
let s = Convert.ToBase64String(hashBytes)
6068
s.Replace("ab", "abab").Replace("\\", "ab")
6169

src/FSharp.Data.WorldBank.Core/WorldBankRuntime.fs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ open FSharp.Data.Runtime.Caching
1818
module Implementation =
1919

2020
let private retryCount = 5
21+
let private retryDelayMs = 2000 // 2 seconds between retries to handle transient API failures (e.g. 502 Bad Gateway)
2122
let private parallelIndicatorPageDownloads = 8
2223

2324
type internal IndicatorRecord =
@@ -85,6 +86,8 @@ module Implementation =
8586
Debug.WriteLine(sprintf "[WorldBank] error: %s" (e.ToString()))
8687

8788
if attempt > 0 then
89+
// Delay before retrying to handle transient server-side failures (e.g. 502 Bad Gateway)
90+
do! Async.Sleep retryDelayMs
8891
return! worldBankRequest (attempt - 1) funcs args
8992
else
9093
return! failwithf "Failed to request '%s'. Error: %O" url e

0 commit comments

Comments
 (0)