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:
+15
-5
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user