From f0e7b9a535830e30ef6dd2740ea7de1b231b09e0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 17 Apr 2026 11:00:42 +0000 Subject: [PATCH 1/2] fix: add retry delay to WorldBank HTTP requests to handle transient 502 errors The WorldBank type provider makes live HTTP requests at compile time to populate the country/indicator/region/topic types. Previously, retries happened immediately with no delay, meaning all 5 retries would fail in rapid succession during transient server-side outages (e.g. 502 Bad Gateway). Add a 2-second delay between retries so that brief API outages are more likely to be survived before all retries are exhausted. Fixes #1748 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/FSharp.Data.WorldBank.Core/WorldBankRuntime.fs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/FSharp.Data.WorldBank.Core/WorldBankRuntime.fs b/src/FSharp.Data.WorldBank.Core/WorldBankRuntime.fs index f0bde68ac..5e6dbe989 100644 --- a/src/FSharp.Data.WorldBank.Core/WorldBankRuntime.fs +++ b/src/FSharp.Data.WorldBank.Core/WorldBankRuntime.fs @@ -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 = @@ -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 From c50316d051a12f3b632d1e5433ad98e6ce6a8ccd Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 17 Apr 2026 11:00:47 +0000 Subject: [PATCH 2/2] ci: trigger checks