* re-assign cluster interface after initializing enterprise interfaces * add a unit test to check if cluster is triggered * remove env overrides Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
19 строки
474 B
Go
19 строки
474 B
Go
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
package platform
|
|
|
|
import "github.com/mattermost/mattermost-server/v6/einterfaces"
|
|
|
|
func (ps *PlatformService) IsLeader() bool {
|
|
if ps.License() != nil && *ps.Config().ClusterSettings.Enable && ps.cluster != nil {
|
|
return ps.cluster.IsLeader()
|
|
}
|
|
|
|
return true
|
|
}
|
|
|
|
func (ps *PlatformService) SetCluster(impl einterfaces.ClusterInterface) {
|
|
ps.cluster = impl
|
|
}
|