- squeue.squeueCond.L.Lock()
- squeue.squeueContents = newSqueueContents
- squeue.squeueCond.Broadcast()
- squeue.squeueCond.L.Unlock()
-}
-
-// CheckSqueue checks if a given container UUID is in the slurm queue. This
-// does not run squeue directly, but instead blocks until woken up by next
-// successful update of squeue.
-func (squeue *Squeue) CheckSqueue(uuid string) bool {
- squeue.squeueCond.L.Lock()
- // block until next squeue broadcast signaling an update.
- squeue.squeueCond.Wait()
- contents := squeue.squeueContents
- squeue.squeueCond.L.Unlock()
-
- for _, k := range contents {
- if k == uuid {
- return true
+ lines := strings.Split(stdout.String(), "\n")
+ sqc.uuids = make(map[string]jobPriority, len(lines))
+ for _, line := range lines {
+ var uuid string
+ var nice int
+ var prio int
+ fmt.Sscan(line, &uuid, &nice, &prio)
+ if uuid != "" {
+ sqc.uuids[uuid] = jobPriority{nice, prio}