@@ -74,54 +74,54 @@ public class RedisSentinel : IRedisSentinel
74
74
/// <summary>
75
75
/// Whether to routinely scan for other sentinel hosts (default true)
76
76
/// </summary>
77
- public bool ScanForOtherSentinels { get ; set ; }
77
+ public bool ScanForOtherSentinels { get ; set ; } = true ;
78
78
79
79
/// <summary>
80
80
/// What interval to scan for other sentinel hosts (default 10 mins)
81
81
/// </summary>
82
- public TimeSpan RefreshSentinelHostsAfter { get ; set ; }
82
+ public TimeSpan RefreshSentinelHostsAfter { get ; set ; } = TimeSpan . FromMinutes ( 10 ) ;
83
83
private DateTime lastSentinelsRefresh ;
84
84
85
85
/// <summary>
86
86
/// How long to wait after failing before connecting to next redis instance (default 250ms)
87
87
/// </summary>
88
- public TimeSpan WaitBetweenFailedHosts { get ; set ; }
88
+ public TimeSpan WaitBetweenFailedHosts { get ; set ; } = TimeSpan . FromMilliseconds ( 250 ) ;
89
89
90
90
/// <summary>
91
91
/// How long to retry connecting to hosts before throwing (default 60 secs)
92
92
/// </summary>
93
- public TimeSpan MaxWaitBetweenFailedHosts { get ; set ; }
93
+ public TimeSpan MaxWaitBetweenFailedHosts { get ; set ; } = TimeSpan . FromSeconds ( 60 ) ;
94
94
95
95
/// <summary>
96
96
/// How long to wait after consecutive failed connection attempts to master before forcing
97
97
/// a Sentinel to failover the current master (default 60 secs)
98
98
/// </summary>
99
- public TimeSpan WaitBeforeForcingMasterFailover { get ; set ; }
99
+ public TimeSpan WaitBeforeForcingMasterFailover { get ; set ; } = TimeSpan . FromSeconds ( 60 ) ;
100
100
101
101
/// <summary>
102
- /// The Max Connection time for Sentinel Worker (default 100ms )
102
+ /// The Max Connection time for Sentinel Worker (default 250ms )
103
103
/// </summary>
104
- public int SentinelWorkerConnectTimeoutMs { get ; set ; }
104
+ public int SentinelWorkerConnectTimeoutMs { get ; set ; } = 250 ;
105
105
106
106
/// <summary>
107
- /// The Max TCP Socket Receive time for Sentinel Worker (default 100ms )
107
+ /// The Max TCP Socket Receive time for Sentinel Worker (default 250ms )
108
108
/// </summary>
109
- public int SentinelWorkerReceiveTimeoutMs { get ; set ; }
109
+ public int SentinelWorkerReceiveTimeoutMs { get ; set ; } = 250 ;
110
110
111
111
/// <summary>
112
- /// The Max TCP Socket Send time for Sentinel Worker (default 100ms )
112
+ /// The Max TCP Socket Send time for Sentinel Worker (default 250ms )
113
113
/// </summary>
114
- public int SentinelWorkerSendTimeoutMs { get ; set ; }
114
+ public int SentinelWorkerSendTimeoutMs { get ; set ; } = 250 ;
115
115
116
116
/// <summary>
117
117
/// Reset client connections when Sentinel reports redis instance is subjectively down (default true)
118
118
/// </summary>
119
- public bool ResetWhenSubjectivelyDown { get ; set ; }
119
+ public bool ResetWhenSubjectivelyDown { get ; set ; } = true ;
120
120
121
121
/// <summary>
122
122
/// Reset client connections when Sentinel reports redis instance is objectively down (default true)
123
123
/// </summary>
124
- public bool ResetWhenObjectivelyDown { get ; set ; }
124
+ public bool ResetWhenObjectivelyDown { get ; set ; } = true ;
125
125
126
126
internal string DebugId => $ "" ;
127
127
@@ -138,16 +138,6 @@ public RedisSentinel(IEnumerable<string> sentinelHosts, string masterName = null
138
138
this . masterName = masterName ?? DefaultMasterName ;
139
139
IpAddressMap = new Dictionary < string , string > ( ) ;
140
140
RedisManagerFactory = ( masters , slaves ) => new PooledRedisClientManager ( masters , slaves ) ;
141
- ScanForOtherSentinels = true ;
142
- RefreshSentinelHostsAfter = TimeSpan . FromMinutes ( 10 ) ;
143
- ResetWhenObjectivelyDown = true ;
144
- ResetWhenSubjectivelyDown = true ;
145
- SentinelWorkerConnectTimeoutMs = 100 ;
146
- SentinelWorkerReceiveTimeoutMs = 100 ;
147
- SentinelWorkerSendTimeoutMs = 100 ;
148
- WaitBetweenFailedHosts = TimeSpan . FromMilliseconds ( 250 ) ;
149
- MaxWaitBetweenFailedHosts = TimeSpan . FromSeconds ( 60 ) ;
150
- WaitBeforeForcingMasterFailover = TimeSpan . FromSeconds ( 60 ) ;
151
141
}
152
142
153
143
/// <summary>
0 commit comments