Runners are removed from manager when alloacted

This removes an existing unlocked shared access to runner.running.
This also sets us up for better management of the runners.
This commit is contained in:
2023-03-08 00:13:40 -07:00
parent f190274bce
commit fe53a17160
5 changed files with 93 additions and 76 deletions
+15 -5
View File
@@ -22,17 +22,27 @@ type Runner struct {
tags []string
conn *websocket.Conn
receiveChan chan []byte
running bool
}
func (r *Runner) HasTags(requestedTags []string) bool {
tagIter:
for _, requestedTag := range requestedTags {
for _, posessedTag := range r.tags {
// if we find the tag, move on to search for the next one
if posessedTag == requestedTag {
continue tagIter
}
}
// if we don't find the tag
return false
}
return true
}
func (r *Runner) Id() uuid.UUID {
return r.id
}
func (r *Runner) Release() {
r.running = false
}
func (r *Runner) RunCommand(cmd string, args []string) (returnCode int64, stdout string, stderr string, err error) {
// Write RunCommand message to client