Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit 09c3ba0

Browse files
committed
updated
1 parent f3ea6a2 commit 09c3ba0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/ServiceStack.Redis/RedisSentinel.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,19 @@ namespace ServiceStack.Redis
1818
{
1919
public class RedisSentinel : IRedisSentinel
2020
{
21+
private readonly string sentinelName;
2122
private int failures = 0;
2223
private int sentinelIndex = -1;
2324
private List<string> sentinels;
2425
private RedisSentinelWorker worker;
2526
private PooledRedisClientManager clientManager;
2627
private static int MaxFailures = 5;
2728

28-
public RedisSentinel(IEnumerable<string> sentinelHosts)
29+
public RedisSentinel(IEnumerable<string> sentinelHosts, string sentinelName)
2930
{
3031
if (sentinelHosts == null || sentinelHosts.Count() == 0) throw new ArgumentException("sentinels must have at least one entry");
3132

33+
this.sentinelName = sentinelName;
3234
this.sentinels = new List<string>(sentinelHosts);
3335
}
3436

@@ -80,7 +82,7 @@ private RedisSentinelWorker GetNextSentinel()
8082
sentinelIndex = 0;
8183
}
8284

83-
var sentinelWorker = new RedisSentinelWorker(sentinels[sentinelIndex], "mymaster", this.clientManager);
85+
var sentinelWorker = new RedisSentinelWorker(sentinels[sentinelIndex], this.sentinelName, this.clientManager);
8486

8587
sentinelWorker.SentinelError += Worker_SentinelError;
8688
return sentinelWorker;

0 commit comments

Comments
 (0)