(masters map[int]string)
| 233 | } |
| 234 | |
| 235 | func (s *Router) SwitchMasters(masters map[int]string) error { |
| 236 | s.mu.Lock() |
| 237 | defer s.mu.Unlock() |
| 238 | if s.closed { |
| 239 | return ErrClosedRouter |
| 240 | } |
| 241 | cache := &redis.InfoCache{ |
| 242 | Auth: s.config.ProductAuth, Timeout: time.Millisecond * 100, |
| 243 | } |
| 244 | for i := range s.slots { |
| 245 | s.trySwitchMaster(i, masters, cache) |
| 246 | } |
| 247 | return nil |
| 248 | } |
| 249 | |
| 250 | func (s *Router) trySwitchMaster(id int, masters map[int]string, cache *redis.InfoCache) { |
| 251 | var switched bool |
nothing calls this directly
no test coverage detected