StackExchange / StackExchange.Redis

General purpose redis client
https://stackexchange.github.io/StackExchange.Redis/
Other
5.88k stars 1.51k forks source link

Support `HeartbeatConsistencyChecks` in `Clone()` #2658

Closed mgravell closed 7 months ago

mgravell commented 7 months ago

release 2.7.23 added a ConfigurationOptions.HeartbeatConsistencyChecks option, but that option is not represented in Clone(); fix that

NickCraver commented 7 months ago

Sooooooo I think I missed this because interval isn't in there either…

NickCraver commented 7 months ago

Thoughts on some reflection-based test for clone checking to prevent future misses?

mgravell commented 7 months ago

Sooooooo I think I missed this because interval isn't in there either…

added; I have no great ideas on the reflection thing - feel free to suggest

mgravell commented 7 months ago

maybe just a count of the fields on ConfigurationOptions with a known expected value:

Assert.Equals(43, fields.Length); // if this fails, check Clone() has been updated
NickCraver commented 7 months ago

+1 I like it - simple and effective we can get fancier if ever justified. Do you mind adding in this PR please? If slammed I can follow-up later in day too.

mgravell commented 7 months ago

@NickCraver already working on it

mgravell commented 7 months ago

@NickCraver see https://github.com/StackExchange/StackExchange.Redis/pull/2658/commits/2a624a241dfcc8c27fd1ab62f1a5a6d4e5a0095b