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

Method removeCommand

pkg/utils/redis/sentinel.go:564–592  ·  view source on GitHub ↗
(client *Client, names []string)

Source from the content-addressed store, hash-verified

562}
563
564func (s *Sentinel) removeCommand(client *Client, names []string) error {
565 exists, err := s.existsCommand(client, names)
566 if err != nil {
567 return err
568 }
569 go func() {
570 var pending int
571 for _, name := range names {
572 if !exists[name] {
573 continue
574 }
575 pending++
576 client.Send("SENTINEL", "remove", name)
577 }
578 if pending != 0 {
579 client.Flush()
580 }
581 }()
582 for _, name := range names {
583 if !exists[name] {
584 continue
585 }
586 _, err := client.Receive()
587 if err != nil {
588 return errors.Trace(err)
589 }
590 }
591 return nil
592}
593
594func (s *Sentinel) removeGroupsDispatch(ctx context.Context, sentinel string, timeout time.Duration,
595 groups map[int]bool) error {

Callers 3

monitorGroupsCommandMethod · 0.95
removeGroupsDispatchMethod · 0.95

Calls 4

existsCommandMethod · 0.95
SendMethod · 0.80
ReceiveMethod · 0.80
FlushMethod · 0.45

Tested by

no test coverage detected