@@ -17,14 +17,15 @@ internal class RedisSentinelWorker : IDisposable
17
17
private readonly RedisEndpoint sentinelEndpoint ;
18
18
private readonly RedisSentinel sentinel ;
19
19
private readonly RedisClient sentinelClient ;
20
- private RedisPubSubServer sentinePubSub ;
20
+ private RedisPubSubServer sentinelPubSub ;
21
21
22
22
public Action < Exception > OnSentinelError ;
23
23
24
24
public RedisSentinelWorker ( RedisSentinel sentinel , RedisEndpoint sentinelEndpoint )
25
25
{
26
26
this . Id = Interlocked . Increment ( ref IdCounter ) ;
27
27
this . sentinel = sentinel ;
28
+ this . sentinelEndpoint = sentinelEndpoint ;
28
29
this . sentinelClient = new RedisClient ( sentinelEndpoint ) {
29
30
Db = 0 , //Sentinel Servers doesn't support DB, reset to 0
30
31
ConnectTimeout = sentinel . SentinelWorkerConnectTimeoutMs ,
@@ -167,18 +168,19 @@ public void BeginListeningForConfigurationChanges()
167
168
{
168
169
lock ( oLock )
169
170
{
170
- if ( this . sentinePubSub == null )
171
+ if ( this . sentinelPubSub == null )
171
172
{
172
- var sentinelManager = new BasicRedisClientManager ( sentinel . SentinelHosts , sentinel . SentinelHosts )
173
+ var currentSentinelHost = new [ ] { sentinelEndpoint } ;
174
+ var sentinelManager = new BasicRedisClientManager ( currentSentinelHost , currentSentinelHost )
173
175
{
174
176
//Use BasicRedisResolver which doesn't validate non-Master Sentinel instances
175
- RedisResolver = new BasicRedisResolver ( sentinel . SentinelEndpoints , sentinel . SentinelEndpoints )
177
+ RedisResolver = new BasicRedisResolver ( currentSentinelHost , currentSentinelHost )
176
178
} ;
177
179
178
180
if ( Log . IsDebugEnabled )
179
181
Log . Debug ( $ "Starting subscription to { sentinel . SentinelHosts . ToArray ( ) } , replicas: { sentinel . SentinelHosts . ToArray ( ) } ...") ;
180
182
181
- this . sentinePubSub = new RedisPubSubServer ( sentinelManager )
183
+ this . sentinelPubSub = new RedisPubSubServer ( sentinelManager )
182
184
{
183
185
HeartbeatInterval = null ,
184
186
IsSentinelSubscription = true ,
0 commit comments