diff options
Diffstat (limited to 'app/cluster_discovery.go')
-rw-r--r-- | app/cluster_discovery.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/app/cluster_discovery.go b/app/cluster_discovery.go index c93684ccd..223b012dd 100644 --- a/app/cluster_discovery.go +++ b/app/cluster_discovery.go @@ -9,6 +9,7 @@ import ( l4g "github.com/alecthomas/log4go" "github.com/mattermost/mattermost-server/model" + "github.com/mattermost/mattermost-server/utils" ) const ( @@ -75,3 +76,11 @@ func (me *ClusterDiscoveryService) Start() { func (me *ClusterDiscoveryService) Stop() { me.stop <- true } + +func (a *App) IsLeader() bool { + if utils.IsLicensed() && *utils.Cfg.ClusterSettings.Enable && a.Cluster != nil { + return a.Cluster.IsLeader() + } else { + return true + } +} |