MM-53879: Fix duplicate loading of license (#25442)

We take a second stab at fixing the issue. Last time,
we were a bit too aggressive in trying to fix a lot of stuff.

I believe changing the cluster event handler had an edge case
somewhere which caused things to fail. Taking a very conservative
approach this time to only fix what is obviously wrong.

Also tested locally in a HA setup.

https://mattermost.atlassian.net/browse/MM-53879
```release-note
NONE
```

Co-authored-by: Mattermost Build <build@mattermost.com>
This commit is contained in:
Agniva De Sarker 2024-01-22 11:04:15 +05:30 committed by GitHub
parent 8364e30a2a
commit 1f431bf722
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 1 additions and 8 deletions

View File

@ -367,9 +367,7 @@ func (ps *PlatformService) Start(broadcastHooks map[string]BroadcastHook) error
message := model.NewWebSocketEvent(model.WebsocketEventLicenseChanged, "", "", "", nil, "")
message.Add("license", ps.GetSanitizedClientLicense())
ps.Go(func() {
ps.Publish(message)
})
ps.Publish(message)
})
return nil
}

View File

@ -227,11 +227,6 @@ func NewServer(options ...Option) (*Server, error) {
return nil, errors.Wrapf(err, "unable to create users service")
}
if model.BuildEnterpriseReady == "true" {
// Dependent on user service
s.LoadLicense()
}
s.licenseWrapper = &licenseWrapper{
srv: s,
}