From 84a733ed56bc8ddfd9e2b4d0b91fd351e982ae97 Mon Sep 17 00:00:00 2001 From: Agniva De Sarker Date: Mon, 7 Mar 2022 19:41:52 +0530 Subject: [PATCH] Move cluster init during server start (#19684) After refactoring the channels init, the config service under channels won't have the config hash until the product gets started. This caused an issue during cluster initialization. Therefore moved it after the product start. ```release-note NONE ``` Co-authored-by: Mattermod --- app/server.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/server.go b/app/server.go index eab1724698..2bf1d11cb2 100644 --- a/app/server.go +++ b/app/server.go @@ -525,11 +525,6 @@ func NewServer(options ...Option) (*Server, error) { s.setupFeatureFlags() }) - if s.joinCluster && s.Cluster != nil { - s.registerClusterHandlers() - s.Cluster.StartInterNodeCommunication() - } - // If configured with a subpath, redirect 404s at the root back into the subpath. if subpath != "/" { s.RootRouter.NotFoundHandler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { @@ -1162,6 +1157,11 @@ func (s *Server) Start() error { } } + if s.joinCluster && s.Cluster != nil { + s.registerClusterHandlers() + s.Cluster.StartInterNodeCommunication() + } + if err := s.ensureInstallationDate(); err != nil { return errors.Wrapf(err, "unable to ensure installation date") }