1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-31 05:04:23 +03:00

Make FailoverClient(sentinel mode) more robust (#1655)

* add failover option AllowDisconnectedSlaves

* checkout unrelated changes

* Make NewFailoverClient (sentinel mode) robust.

* fix lint issue

* Fix bug

* Fix lint issue

* add comment

* checkout unrelated changes

* Refine code

* checkout unrelated changes
This commit is contained in:
renzheng.wang
2021-02-10 23:20:08 +08:00
committed by GitHub
parent f594401261
commit 8b19c31049
2 changed files with 53 additions and 9 deletions

View File

@ -43,3 +43,8 @@ func (s *source) Seed(seed int64) {
s.src.Seed(seed)
s.mu.Unlock()
}
// Shuffle pseudo-randomizes the order of elements.
// n is the number of elements.
// swap swaps the elements with indexes i and j.
func Shuffle(n int, swap func(i, j int)) { pseudo.Shuffle(n, swap) }