We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 3884515 + c50316d commit 4abfd83Copy full SHA for 4abfd83
1 file changed
src/FSharp.Data.WorldBank.Core/WorldBankRuntime.fs
@@ -18,6 +18,7 @@ open FSharp.Data.Runtime.Caching
18
module Implementation =
19
20
let private retryCount = 5
21
+ let private retryDelayMs = 2000 // 2 seconds between retries to handle transient API failures (e.g. 502 Bad Gateway)
22
let private parallelIndicatorPageDownloads = 8
23
24
type internal IndicatorRecord =
@@ -85,6 +86,8 @@ module Implementation =
85
86
Debug.WriteLine(sprintf "[WorldBank] error: %s" (e.ToString()))
87
88
if attempt > 0 then
89
+ // Delay before retrying to handle transient server-side failures (e.g. 502 Bad Gateway)
90
+ do! Async.Sleep retryDelayMs
91
return! worldBankRequest (attempt - 1) funcs args
92
else
93
return! failwithf "Failed to request '%s'. Error: %O" url e
0 commit comments