MCPcopy Index your code
hub / github.com/CodisLabs/codis / monitorGroupsDispatch

Method monitorGroupsDispatch

pkg/utils/redis/sentinel.go:478–492  ·  view source on GitHub ↗
(ctx context.Context, sentinel string, timeout time.Duration,
	config *MonitorConfig, groups map[int]*net.TCPAddr)

Source from the content-addressed store, hash-verified

476}
477
478func (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
494func (s *Sentinel) MonitorGroups(sentinels []string, timeout time.Duration, config *MonitorConfig, groups map[int]string) error {
495 cntx, cancel := context.WithTimeout(s.Context, timeout)

Callers 1

MonitorGroupsMethod · 0.95

Calls 2

dispatchMethod · 0.95
monitorGroupsCommandMethod · 0.95

Tested by

no test coverage detected