mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2025-07-23 21:01:40 +02:00
Refactor taggers. Refine Job Hooks. Start job classifier
This commit is contained in:
@@ -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) {
|
||||
}
|
||||
|
Reference in New Issue
Block a user