Skip to content
This repository was archived by the owner on Aug 31, 2024. It is now read-only.

Commit a5d20cb

Browse files
committed
Merge branch 'develop'
2 parents 9f4e1e5 + cd711ff commit a5d20cb

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/BuildStats/BuildStats.fsproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<TargetFramework>netcoreapp3.1</TargetFramework>
5-
<Version>5.24.0</Version>
5+
<Version>5.24.1</Version>
66
<AssemblyName>BuildStats</AssemblyName>
77
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
88
<EnableDefaultContentItems>false</EnableDefaultContentItems>

src/BuildStats/HttpClients.fs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ open System.Net.Http.Headers
77
open System.Threading.Tasks
88
open FSharp.Control.Tasks.V2.ContextInsensitive
99
open Logfella
10+
open Microsoft.Net.Http.Headers
1011

1112
exception BrokenCircuitException
1213

@@ -28,9 +29,12 @@ type CircuitBreakerHttpClient (httpClient : IResilientHttpClient,
2829
let mutable brokenSince = DateTime.MinValue
2930

3031
let getBreakDuration (response : HttpResponseMessage) =
31-
match response.Headers.RetryAfter.Delta.HasValue with
32-
| true -> max minBreakDuration response.Headers.RetryAfter.Delta.Value
32+
match response.Headers.Contains HeaderNames.RetryAfter with
3333
| false -> minBreakDuration
34+
| true ->
35+
match response.Headers.RetryAfter.Delta.HasValue with
36+
| true -> max minBreakDuration response.Headers.RetryAfter.Delta.Value
37+
| false -> minBreakDuration
3438

3539
let isClientError (status : HttpStatusCode) =
3640
let clientErrorCodes =

0 commit comments

Comments
 (0)