Utilify runner tag printing function

This commit is contained in:
2023-03-07 23:09:49 -07:00
parent d9ba14550e
commit f190274bce
3 changed files with 25 additions and 20 deletions
+3 -10
View File
@@ -3,7 +3,6 @@ package runnermanager
import (
"context"
"fmt"
"strings"
"time"
"github.com/google/uuid"
@@ -13,6 +12,7 @@ import (
"git.ohea.xyz/cursorius/server/config"
"git.ohea.xyz/cursorius/server/database"
"git.ohea.xyz/cursorius/server/util"
runner_api "git.ohea.xyz/cursorius/runner-api/go/api/v2"
)
@@ -51,15 +51,8 @@ type runnerJob struct {
}
func (r *runnerManager) processRequest(req GetRunnerRequest) {
var runnerTagsStr strings.Builder
if len(req.Tags) > 0 {
fmt.Fprintf(&runnerTagsStr, "[%v", req.Tags[0])
for _, tag := range req.Tags[1:] {
fmt.Fprintf(&runnerTagsStr, ", %v", tag)
}
fmt.Fprintf(&runnerTagsStr, "]")
}
log.Infof("Got request for runner with tags \"%v\"", runnerTagsStr.String())
tagsStr := util.FormatTags(req.Tags)
log.Infof("Got request for runner with tags \"%v\"", tagsStr)
log.Debugf("Finding runner with tags %v", runnerTagsStr.String())