Enable PluginJobs (#10198)
Этот коммит содержится в:
коммит произвёл
Hanzei
родитель
ac68236b88
Коммит
06f384df6d
@@ -114,6 +114,13 @@ func (watcher *Watcher) PollAndNotify() {
|
||||
default:
|
||||
}
|
||||
}
|
||||
} else if job.Type == model.JOB_TYPE_PLUGINS {
|
||||
if watcher.workers.Plugins != nil {
|
||||
select {
|
||||
case watcher.workers.Plugins.JobChannel() <- *job:
|
||||
default:
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ func (srv *JobServer) InitWorkers() *Workers {
|
||||
}
|
||||
|
||||
if pluginsInterface := srv.Plugins; pluginsInterface != nil {
|
||||
workers.Migrations = pluginsInterface.MakeWorker()
|
||||
workers.Plugins = pluginsInterface.MakeWorker()
|
||||
}
|
||||
|
||||
return workers
|
||||
@@ -92,6 +92,10 @@ func (workers *Workers) Start() *Workers {
|
||||
go workers.Migrations.Run()
|
||||
}
|
||||
|
||||
if workers.Plugins != nil {
|
||||
go workers.Plugins.Run()
|
||||
}
|
||||
|
||||
go workers.Watcher.Start()
|
||||
})
|
||||
|
||||
@@ -173,6 +177,10 @@ func (workers *Workers) Stop() *Workers {
|
||||
workers.Migrations.Stop()
|
||||
}
|
||||
|
||||
if workers.Plugins != nil {
|
||||
workers.Plugins.Stop()
|
||||
}
|
||||
|
||||
mlog.Info("Stopped workers")
|
||||
|
||||
return workers
|
||||
|
||||
Ссылка в новой задаче
Block a user