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 <mattermod@users.noreply.github.com>
Этот коммит содержится в:
Agniva De Sarker
2022-03-07 19:41:52 +05:30
коммит произвёл GitHub
родитель 897e7bb9e7
Коммит 84a733ed56

Просмотреть файл

@@ -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")
}