This repository was archived by the owner on Dec 24, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -18,17 +18,19 @@ namespace ServiceStack.Redis
18
18
{
19
19
public class RedisSentinel : IRedisSentinel
20
20
{
21
+ private readonly string sentinelName ;
21
22
private int failures = 0 ;
22
23
private int sentinelIndex = - 1 ;
23
24
private List < string > sentinels ;
24
25
private RedisSentinelWorker worker ;
25
26
private PooledRedisClientManager clientManager ;
26
27
private static int MaxFailures = 5 ;
27
28
28
- public RedisSentinel ( IEnumerable < string > sentinelHosts )
29
+ public RedisSentinel ( IEnumerable < string > sentinelHosts , string sentinelName )
29
30
{
30
31
if ( sentinelHosts == null || sentinelHosts . Count ( ) == 0 ) throw new ArgumentException ( "sentinels must have at least one entry" ) ;
31
32
33
+ this . sentinelName = sentinelName ;
32
34
this . sentinels = new List < string > ( sentinelHosts ) ;
33
35
}
34
36
@@ -80,7 +82,7 @@ private RedisSentinelWorker GetNextSentinel()
80
82
sentinelIndex = 0 ;
81
83
}
82
84
83
- var sentinelWorker = new RedisSentinelWorker ( sentinels [ sentinelIndex ] , "mymaster" , this . clientManager ) ;
85
+ var sentinelWorker = new RedisSentinelWorker ( sentinels [ sentinelIndex ] , this . sentinelName , this . clientManager ) ;
84
86
85
87
sentinelWorker . SentinelError += Worker_SentinelError ;
86
88
return sentinelWorker ;
You can’t perform that action at this time.
0 commit comments