(client *Client, names []string)
| 562 | } |
| 563 | |
| 564 | func (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 | |
| 594 | func (s *Sentinel) removeGroupsDispatch(ctx context.Context, sentinel string, timeout time.Duration, |
| 595 | groups map[int]bool) error { |
no test coverage detected