Files
mostlymatter/app/platform/cluster.go
Ibrahim Serdar Acikgoz 8e0d46e0c6 re-assign cluster interface after initializing enterprise interfaces (#20839)
* 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>
2022-08-17 23:07:04 +03:00

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
}