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

Commit 51efbdc

Browse files
committed
Add additional Failover API to IRedisFailover
1 parent 9475763 commit 51efbdc

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/ServiceStack.Redis/IRedisFailover.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,7 @@ public interface IRedisFailover
88
List<Action<IRedisClientsManager>> OnFailover { get; }
99

1010
void FailoverTo(params string[] readWriteHosts);
11+
12+
void FailoverTo(IEnumerable<string> readWriteHosts, IEnumerable<string> readOnlyHosts);
1113
}
1214
}

src/ServiceStack.Redis/RedisManagerPool.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
using System;
55
using System.Collections.Generic;
6+
using System.Linq;
67
using System.Threading;
78
using ServiceStack.Caching;
89
using ServiceStack.Logging;
@@ -103,6 +104,11 @@ public void FailoverTo(params string[] readWriteHosts)
103104
}
104105
}
105106

107+
public void FailoverTo(IEnumerable<string> readWriteHosts, IEnumerable<string> readOnlyHosts)
108+
{
109+
FailoverTo(readWriteHosts.ToArray()); //only use readWriteHosts
110+
}
111+
106112
/// <summary>
107113
/// Returns a Read/Write client (The default) using the hosts defined in ReadWriteHosts
108114
/// </summary>

0 commit comments

Comments
 (0)