mirror of
https://github.com/status-im/consul.git
synced 2025-01-11 14:24:39 +00:00
Move autopilot setup to a separate file
This commit is contained in:
parent
d08ab9fd19
commit
039e7f1880
@ -294,9 +294,8 @@ func NewServerLogger(config *Config, logger *log.Logger, tokens *token.Store) (*
|
||||
shutdownCh: shutdownCh,
|
||||
}
|
||||
|
||||
// Set up autopilot
|
||||
apDelegate := &AutopilotDelegate{s}
|
||||
s.autopilot = autopilot.NewAutopilot(logger, apDelegate, config.AutopilotInterval, config.ServerHealthInterval)
|
||||
// Run divergent OSS/Enterprise setup
|
||||
s.startServerEnterprise(config)
|
||||
|
||||
// Initialize the stats fetcher that autopilot will use.
|
||||
s.statsFetcher = NewStatsFetcher(logger, s.connPool, s.config.Datacenter)
|
||||
|
@ -1,5 +1,7 @@
|
||||
package consul
|
||||
|
||||
import "github.com/hashicorp/consul/agent/consul/autopilot"
|
||||
|
||||
func init() {
|
||||
registerEndpoint(func(s *Server) interface{} { return &ACL{s} })
|
||||
registerEndpoint(func(s *Server) interface{} { return &Catalog{s} })
|
||||
@ -13,3 +15,9 @@ func init() {
|
||||
registerEndpoint(func(s *Server) interface{} { return &Status{s} })
|
||||
registerEndpoint(func(s *Server) interface{} { return &Txn{s} })
|
||||
}
|
||||
|
||||
func (s *Server) startServerEnterprise(config *Config) {
|
||||
// Set up autopilot
|
||||
apDelegate := &AutopilotDelegate{s}
|
||||
s.autopilot = autopilot.NewAutopilot(s.logger, apDelegate, config.AutopilotInterval, config.ServerHealthInterval)
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user