MCPcopy
hub / github.com/CodisLabs/codis / removeGroupsAllDispatch

Method removeGroupsAllDispatch

pkg/utils/redis/sentinel.go:648–669  ·  view source on GitHub ↗
(ctx context.Context, sentinel string, timeout time.Duration)

Source from the content-addressed store, hash-verified

646}
647
648func (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
671func (s *Sentinel) RemoveGroupsAll(sentinels []string, timeout time.Duration) error {
672 cntx, cancel := context.WithTimeout(s.Context, timeout)

Callers 1

RemoveGroupsAllMethod · 0.95

Calls 4

dispatchMethod · 0.95
mastersCommandMethod · 0.95
NodeNameMethod · 0.95
removeCommandMethod · 0.95

Tested by

no test coverage detected