(ctx context.Context, sentinel string, timeout time.Duration, config *MonitorConfig, groups map[int]*net.TCPAddr)
| 476 | } |
| 477 | |
| 478 | func (s *Sentinel) monitorGroupsDispatch(ctx context.Context, sentinel string, timeout time.Duration, |
| 479 | config *MonitorConfig, groups map[int]*net.TCPAddr) error { |
| 480 | var err = s.dispatch(ctx, sentinel, timeout, func(c *Client) error { |
| 481 | return s.monitorGroupsCommand(c, sentinel, config, groups) |
| 482 | }) |
| 483 | if err != nil { |
| 484 | switch errors.Cause(err) { |
| 485 | case context.Canceled: |
| 486 | return nil |
| 487 | default: |
| 488 | return err |
| 489 | } |
| 490 | } |
| 491 | return nil |
| 492 | } |
| 493 | |
| 494 | func (s *Sentinel) MonitorGroups(sentinels []string, timeout time.Duration, config *MonitorConfig, groups map[int]string) error { |
| 495 | cntx, cancel := context.WithTimeout(s.Context, timeout) |
no test coverage detected