mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2025-07-23 21:01:40 +02:00
Add api for tag handling within cc-backend
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// Copyright (C) 2023 NHR@FAU, University Erlangen-Nuremberg.
|
||||
// All rights reserved.
|
||||
// Copyright (C) NHR@FAU, University Erlangen-Nuremberg.
|
||||
// All rights reserved. This file is part of cc-backend.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
package tagger
|
||||
@@ -72,7 +72,7 @@ func (t *AppTagger) Match(job *schema.Job) {
|
||||
for _, s := range a.strings {
|
||||
if strings.Contains(jobscript, s) {
|
||||
if !r.HasTag(id, tagType, tag) {
|
||||
r.AddTagOrCreate(id, tagType, tag)
|
||||
r.AddTagOrCreateDirect(id, tagType, tag)
|
||||
break out
|
||||
}
|
||||
}
|
||||
|
@@ -43,7 +43,7 @@ func TestRegister(t *testing.T) {
|
||||
func TestMatch(t *testing.T) {
|
||||
r := setup(t)
|
||||
|
||||
job, err := r.FindById(5)
|
||||
job, err := r.FindByIdDirect(5)
|
||||
noErr(t, err)
|
||||
|
||||
var tagger AppTagger
|
||||
|
Reference in New Issue
Block a user