Migrate cluster to use Server struct directly. (#10101)

Этот коммит содержится в:
Christopher Speller
2019-01-15 09:09:25 -08:00
коммит произвёл GitHub
родитель 004e7d383b
Коммит ae76d27b7d
6 изменённых файлов: 33 добавлений и 17 удалений

Просмотреть файл

@@ -112,6 +112,10 @@ type Server struct {
Log *mlog.Logger
joinCluster bool
startMetrics bool
startElasticsearch bool
AccountMigration einterfaces.AccountMigrationInterface
Cluster einterfaces.ClusterInterface
Compliance einterfaces.ComplianceInterface
@@ -214,16 +218,16 @@ func NewServer(options ...Option) (*Server, error) {
mlog.Error(fmt.Sprint("Error to reset the server status.", result.Err.Error()))
}
if s.Cluster != nil {
if s.joinCluster && s.Cluster != nil {
s.FakeApp().RegisterAllClusterMessageHandlers()
s.Cluster.StartInterNodeCommunication()
}
if s.Metrics != nil {
if s.startMetrics && s.Metrics != nil {
s.Metrics.StartServer()
}
if s.Elasticsearch != nil {
if s.startElasticsearch && s.Elasticsearch != nil {
s.StartElasticsearch()
}