Files
mattermost/server/channels
Agniva De Sarker 6d41ee171e MM-56611: Move license expiration check to be synchronous (#26010)
During server start, runLicenseExpirationCheckJob was being called
from a goroutine which would eventually call SetLicense and iterate
through the ps.licenseListeners.

But at the same time doElasticsearchFixChannelIndex would also
call AddLicenseListener and try to edit the ps.licenseListeners map,
leading to a race condition.

To fix this, we simply move the runLicenseExpirationCheckJob
to be synchronous. This fixes the race, and also improves
the correctness because after 1f431bf722
there was no license check being done synchronously during server boot.

So theoretically, the server might go on doing some stuff
until the Go runtime decides to run the license check goroutine.

https://mattermost.atlassian.net/browse/MM-56611

```release-note
NONE
```
2024-01-24 11:59:42 +05:30
..
2023-10-11 10:13:36 +02:00
2023-03-22 17:22:27 -04:00