Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/FSharp.Data.WorldBank.Core/WorldBankRuntime.fs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ open FSharp.Data.Runtime.Caching
module Implementation =

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

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

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