From 29a7e182a6a9c2970b9c2c2d55062d17f33f084e Mon Sep 17 00:00:00 2001 From: Corey Hulen Date: Wed, 16 Aug 2017 10:29:45 -0700 Subject: PLT-6079 Adding leader election (#7105) --- utils/config.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'utils/config.go') diff --git a/utils/config.go b/utils/config.go index 187af4125..af88f816e 100644 --- a/utils/config.go +++ b/utils/config.go @@ -653,3 +653,11 @@ func Desanitize(cfg *model.Config) { cfg.SqlSettings.DataSourceSearchReplicas[i] = Cfg.SqlSettings.DataSourceSearchReplicas[i] } } + +func IsLeader() bool { + if IsLicensed && *Cfg.ClusterSettings.Enable && einterfaces.GetClusterInterface() != nil { + return einterfaces.GetClusterInterface().IsLeader() + } else { + return true + } +} -- cgit v1.2.3-1-g7c22