Refactor taggers. Refine Job Hooks. Start job classifier

This commit is contained in:
2025-05-22 07:10:41 +02:00
parent 9abc206d1a
commit ca634bb707
14 changed files with 316 additions and 61 deletions

View File

@@ -13,7 +13,7 @@ import (
type Tagger interface {
Register() error
Match(job *schema.Job)
Match(job *schema.JobMeta)
}
var (
@@ -31,6 +31,8 @@ func Init() {
jobTagger = &JobTagger{}
jobTagger.startTaggers = make([]Tagger, 0)
jobTagger.startTaggers = append(jobTagger.startTaggers, &AppTagger{})
jobTagger.stopTaggers = make([]Tagger, 0)
jobTagger.stopTaggers = append(jobTagger.startTaggers, &JobClassTagger{})
for _, tagger := range jobTagger.startTaggers {
tagger.Register()
@@ -46,5 +48,5 @@ func (jt *JobTagger) JobStartCallback(job *schema.Job) {
}
}
func (jt *JobTagger) JobStopCallback(job *schema.Job) {
func (jt *JobTagger) JobStopCallback(job *schema.JobMeta) {
}