X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/0632129bf7861a6ca3ef4ff4e21006a5f11e8be0..59eb2058e7111581645c960ba868f49f0fed152b:/services/crunch-dispatch-slurm/squeue.go diff --git a/services/crunch-dispatch-slurm/squeue.go b/services/crunch-dispatch-slurm/squeue.go index 819c2d2510..5ecfe8ff2f 100644 --- a/services/crunch-dispatch-slurm/squeue.go +++ b/services/crunch-dispatch-slurm/squeue.go @@ -8,7 +8,6 @@ import ( "bytes" "fmt" "log" - "os/exec" "strings" "sync" "time" @@ -29,12 +28,6 @@ type SqueueChecker struct { sync.Cond } -func squeueFunc() *exec.Cmd { - return exec.Command("squeue", "--all", "--format=%j %y %Q") -} - -var squeueCmd = squeueFunc - // HasUUID 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. @@ -84,7 +77,7 @@ func (sqc *SqueueChecker) check() { sqc.L.Lock() defer sqc.L.Unlock() - cmd := squeueCmd() + cmd := theConfig.slurm.QueueCommand([]string{"--all", "--format=%j %y %Q"}) stdout, stderr := &bytes.Buffer{}, &bytes.Buffer{} cmd.Stdout, cmd.Stderr = stdout, stderr if err := cmd.Run(); err != nil {