diff options
Diffstat (limited to 'utils/config.go')
-rw-r--r-- | utils/config.go | 8 |
1 files changed, 8 insertions, 0 deletions
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 + } +} |