1
0
Fork 0

Reporting interval was too high

Looks the 10x was a debug code.
master
Philip O'Toole 1 year ago
parent 11c4a7999b
commit 3b6d235872

@ -503,6 +503,8 @@ func createCluster(cfg *Config, hasPeers bool, joiner *cluster.Joiner, str *stor
if err != nil {
return fmt.Errorf("failed to start discovery service: %s", err.Error())
}
// Safe to start reporting before doing registration. If the node hasn't bootstrapped
// yet, or isn't leader, reporting will just be a no-op until something changes.
go discoService.StartReporting(cfg.NodeID, cfg.HTTPURL(), cfg.RaftAdv)
httpServ.RegisterStatus("disco", discoService)

@ -52,7 +52,7 @@ func NewService(c Client, s Store) *Service {
s: s,
RegisterInterval: 3 * time.Second,
ReportInterval: 30 * time.Second,
ReportInterval: 10 * time.Second,
logger: log.New(os.Stderr, "[disco] ", log.LstdFlags),
}
}
@ -89,7 +89,7 @@ func (s *Service) Register(id, apiAddr, addr string) (bool, string, error) {
// to deal with any intermittent issues that caused Leadership information
// to go stale.
func (s *Service) StartReporting(id, apiAddr, addr string) chan struct{} {
ticker := time.NewTicker(10 * s.ReportInterval)
ticker := time.NewTicker(s.ReportInterval)
obCh := make(chan struct{}, leaderChanLen)
s.s.RegisterLeaderChange(obCh)

Loading…
Cancel
Save