(ctx context.Context, sentinel string, timeout time.Duration)
| 646 | } |
| 647 | |
| 648 | func (s *Sentinel) removeGroupsAllDispatch(ctx context.Context, sentinel string, timeout time.Duration) error { |
| 649 | var err = s.dispatch(ctx, sentinel, timeout, func(c *Client) error { |
| 650 | masters, err := s.mastersCommand(c) |
| 651 | if err != nil { |
| 652 | return err |
| 653 | } |
| 654 | var names []string |
| 655 | for gid := range masters { |
| 656 | names = append(names, s.NodeName(gid)) |
| 657 | } |
| 658 | return s.removeCommand(c, names) |
| 659 | }) |
| 660 | if err != nil { |
| 661 | switch errors.Cause(err) { |
| 662 | case context.Canceled: |
| 663 | return nil |
| 664 | default: |
| 665 | return err |
| 666 | } |
| 667 | } |
| 668 | return nil |
| 669 | } |
| 670 | |
| 671 | func (s *Sentinel) RemoveGroupsAll(sentinels []string, timeout time.Duration) error { |
| 672 | cntx, cancel := context.WithTimeout(s.Context, timeout) |
no test coverage detected