mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Wait for goroutines to finish before shuting down server (#8259)
When running server tests, the server will exit while some jobs spawned through a goroutine are still running. This may crash the test harness, as the jobs try to access a shut down app instance. Fortunately the fix is easy: we just have to use the same App goroutine-counting facility than the rest of the method's goroutines.
This commit is contained in:
committed by
Chris
parent
cafa4e4370
commit
44a27125de
@@ -130,11 +130,21 @@ func runServer(configFileLocation string, disableConfigWatch bool, interruptChan
|
||||
|
||||
a.EnsureDiagnosticId()
|
||||
|
||||
go runSecurityJob(a)
|
||||
go runDiagnosticsJob(a)
|
||||
go runSessionCleanupJob(a)
|
||||
go runTokenCleanupJob(a)
|
||||
go runCommandWebhookCleanupJob(a)
|
||||
a.Go(func() {
|
||||
runSecurityJob(a)
|
||||
})
|
||||
a.Go(func() {
|
||||
runDiagnosticsJob(a)
|
||||
})
|
||||
a.Go(func() {
|
||||
runSessionCleanupJob(a)
|
||||
})
|
||||
a.Go(func() {
|
||||
runTokenCleanupJob(a)
|
||||
})
|
||||
a.Go(func() {
|
||||
runCommandWebhookCleanupJob(a)
|
||||
})
|
||||
|
||||
if complianceI := a.Compliance; complianceI != nil {
|
||||
complianceI.StartComplianceDailyJob()
|
||||
|
||||
Reference in New Issue
Block a user