MM-13873: Fix race condition on filesystem licence load (#10196)

Этот коммит содержится в:
Jesús Espino
2019-01-29 16:57:38 +01:00
коммит произвёл Christopher Speller
родитель 8e44f38499
Коммит d1a758a06e

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

@@ -92,10 +92,10 @@ func (a *App) SaveLicense(licenseBytes []byte) (*model.License, *model.AppError)
// start job server if necessary - this handles the edge case where a license file is uploaded, but the job server
// doesn't start until the server is restarted, which prevents the 'run job now' buttons in system console from
// functioning as expected
if *a.Config().JobSettings.RunJobs {
if *a.Config().JobSettings.RunJobs && a.Srv.Jobs != nil && a.Srv.Jobs.Workers != nil {
a.Srv.Jobs.StartWorkers()
}
if *a.Config().JobSettings.RunScheduler {
if *a.Config().JobSettings.RunScheduler && a.Srv.Jobs != nil && a.Srv.Jobs.Schedulers != nil {
a.Srv.Jobs.StartSchedulers()
}