1
0
mirror of https://github.com/redis/go-redis.git synced 2025-08-08 23:42:06 +03:00

Merge pull request #974 from EtienneM/fix/973/sentinel_failover

Add the failover sentinel command
This commit is contained in:
Vladimir Mihailenco
2019-02-20 15:48:28 +02:00
committed by GitHub

View File

@@ -164,6 +164,14 @@ func (c *SentinelClient) Sentinels(name string) *SliceCmd {
return cmd
}
// Failover forces a failover as if the master was not reachable, and without
// asking for agreement to other Sentinels.
func (c *SentinelClient) Failover(name string) *StatusCmd {
cmd := NewStatusCmd("sentinel", "failover", name)
c.Process(cmd)
return cmd
}
type sentinelFailover struct {
sentinelAddrs []string