[MM-54132] Use annotated logger for log messages from jobs (#24275)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
fcfcbd9909
Коммит
30b12f199b
@@ -8,16 +8,14 @@ import (
|
||||
"github.com/mattermost/mattermost/server/v8/channels/jobs"
|
||||
)
|
||||
|
||||
const (
|
||||
JobName = "PostPersistentNotifications"
|
||||
)
|
||||
|
||||
type AppIface interface {
|
||||
SendPersistentNotifications() error
|
||||
IsPersistentNotificationsEnabled() bool
|
||||
}
|
||||
|
||||
func MakeWorker(jobServer *jobs.JobServer, app AppIface) model.Worker {
|
||||
func MakeWorker(jobServer *jobs.JobServer, app AppIface) *jobs.SimpleWorker {
|
||||
const workerName = "PostPersistentNotifications"
|
||||
|
||||
isEnabled := func(_ *model.Config) bool {
|
||||
return app.IsPersistentNotificationsEnabled()
|
||||
}
|
||||
@@ -25,6 +23,6 @@ func MakeWorker(jobServer *jobs.JobServer, app AppIface) model.Worker {
|
||||
defer jobServer.HandleJobPanic(job)
|
||||
return app.SendPersistentNotifications()
|
||||
}
|
||||
worker := jobs.NewSimpleWorker(JobName, jobServer, execute, isEnabled)
|
||||
worker := jobs.NewSimpleWorker(workerName, jobServer, execute, isEnabled)
|
||||
return worker
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user