mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2026-02-20 09:47:30 +01:00
Cleanup and handle error in AppTagger
This commit is contained in:
@@ -279,8 +279,6 @@ func initSubsystems() error {
|
|||||||
return fmt.Errorf("initializing archive: %w", err)
|
return fmt.Errorf("initializing archive: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Note: metricstore.Init() is called later in runServer() with proper configuration
|
|
||||||
|
|
||||||
// Handle database re-initialization
|
// Handle database re-initialization
|
||||||
if flagReinitDB {
|
if flagReinitDB {
|
||||||
if err := importer.InitDB(); err != nil {
|
if err := importer.InitDB(); err != nil {
|
||||||
|
|||||||
@@ -174,7 +174,9 @@ func (t *AppTagger) Match(job *schema.Job) {
|
|||||||
for _, re := range a.patterns {
|
for _, re := range a.patterns {
|
||||||
if re.MatchString(jobscriptLower) {
|
if re.MatchString(jobscriptLower) {
|
||||||
if !r.HasTag(id, t.tagType, a.tag) {
|
if !r.HasTag(id, t.tagType, a.tag) {
|
||||||
r.AddTagOrCreateDirect(id, t.tagType, a.tag)
|
if _, err := r.AddTagOrCreateDirect(id, t.tagType, a.tag); err != nil {
|
||||||
|
cclog.Errorf("AppTagger: failed to add tag '%s' to job %d: %v", a.tag, id, err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break out
|
break out
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user