summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/app.go1
-rw-r--r--app/cluster.go6
2 files changed, 6 insertions, 1 deletions
diff --git a/app/app.go b/app/app.go
index dabd00571..d8974a48c 100644
--- a/app/app.go
+++ b/app/app.go
@@ -244,6 +244,7 @@ func New(options ...Option) (outApp *App, outErr error) {
})
app.clusterLeaderListenerId = app.AddClusterLeaderChangedListener(func() {
+ mlog.Info("Cluster leader changed. Determining if job schedulers should be running:", mlog.Bool("isLeader", app.IsLeader()))
app.Jobs.Schedulers.HandleClusterLeaderChange(app.IsLeader())
})
diff --git a/app/cluster.go b/app/cluster.go
index 020e57c61..22b9843b8 100644
--- a/app/cluster.go
+++ b/app/cluster.go
@@ -3,7 +3,10 @@
package app
-import "github.com/mattermost/mattermost-server/model"
+import (
+ "github.com/mattermost/mattermost-server/mlog"
+ "github.com/mattermost/mattermost-server/model"
+)
// Registers a given function to be called when the cluster leader may have changed. Returns a unique ID for the
// listener which can later be used to remove it. If clustering is not enabled in this build, the callback will never
@@ -20,6 +23,7 @@ func (a *App) RemoveClusterLeaderChangedListener(id string) {
}
func (a *App) InvokeClusterLeaderChangedListeners() {
+ mlog.Info("Cluster leader changed. Invoking ClusterLeaderChanged listeners.")
a.Go(func() {
a.clusterLeaderListeners.Range(func(_, listener interface{}) bool {
listener.(func())()