Skip to content

Commit 3168c36

Browse files
authored
Merge branch 'main' into repo-assist/test-structural-inference-2026-04-17-cd136a8845dc218d
2 parents d4c5516 + 4abfd83 commit 3168c36

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

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)