1
0

feat(daemon): task grouping

This commit is contained in:
2024-02-26 08:55:27 +00:00
parent 2b4db95166
commit 329e429c74
6 changed files with 56 additions and 45 deletions

View File

@ -16,6 +16,7 @@ import (
"time"
"github.com/davecgh/go-spew/spew"
"github.com/google/uuid"
"github.com/remeh/sizedwaitgroup"
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
@ -98,6 +99,9 @@ type PewCmd struct {
useRemote bool
remoteAddr string
// UUID of the job set
groupUUID string
}
func (cmd *PewCmd) getRepoName(worktree string, ka artifact.Artifact) {
@ -149,6 +153,7 @@ func (cmd *PewCmd) syncRepo(worktree string, ka artifact.Artifact) (err error) {
}
func (cmd *PewCmd) Run(g *Globals) (err error) {
cmd.groupUUID = uuid.New().String()
cmd.useRemote = g.Remote
cmd.remoteAddr = g.RemoteAddr
@ -330,6 +335,7 @@ func (cmd PewCmd) remote(swg *sizedwaitgroup.SizedWaitGroup,
log.Trace().Msgf("kernelinfo: %v", spew.Sdump(ki))
job := api.Job{}
job.Group = cmd.groupUUID
job.RepoName = cmd.repoName
job.Commit = cmd.commit