Skip to content

Commit e48647b

Browse files
authored
Merge pull request #149 from Flagsmith/fix/timeout-seconds
fix: RequestTimeout would return the seconds component of its TimeSpan instead of the total duration in seconds
2 parents 25f657f + 99a7d63 commit e48647b

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

Flagsmith.Client.Test/FlagsmithTest.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -802,5 +802,15 @@ public async Task TestGetIdentityFlagsTransientIdentityWithoutTraitCallsExpected
802802
Assert.True(await identityFlags.IsFeatureEnabled("some_feature"));
803803
Assert.Equal("some-identity-trait-value", await identityFlags.GetFeatureValue("some_feature"));
804804
}
805+
806+
[Fact]
807+
public void TestRequestTimeoutInterpretsSecondsCorrectly()
808+
{
809+
var config = new FlagsmithConfiguration
810+
{
811+
RequestTimeout = 100
812+
};
813+
Assert.Equal(100, config.RequestTimeout);
814+
}
805815
}
806816
}

Flagsmith.FlagsmithClient/FlagsmithConfiguration.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public int EnvironmentRefreshIntervalSeconds
8181
/// </summary>
8282
public Double? RequestTimeout
8383
{
84-
get => _timeout.Seconds;
84+
get => _timeout.TotalSeconds;
8585
set => _timeout = TimeSpan.FromSeconds(value ?? 100);
8686
}
8787

0 commit comments

Comments
 (0)