documentation: disable download buffering in our sample nginx config for
[arvados.git] / services / crunch-dispatch-local / crunch-dispatch-local.go
index 62935447dd66643f8f76b6f8bf3a12c0c9b0c678..2922817b557ccef70fa25f32c66b8447575abb5d 100644 (file)
@@ -17,9 +17,9 @@ import (
        "syscall"
        "time"
 
-       "git.curoverse.com/arvados.git/sdk/go/arvados"
-       "git.curoverse.com/arvados.git/sdk/go/arvadosclient"
-       "git.curoverse.com/arvados.git/sdk/go/dispatch"
+       "git.arvados.org/arvados.git/sdk/go/arvados"
+       "git.arvados.org/arvados.git/sdk/go/arvadosclient"
+       "git.arvados.org/arvados.git/sdk/go/dispatch"
        "github.com/sirupsen/logrus"
 )
 
@@ -155,6 +155,17 @@ func (lr *LocalRun) run(dispatcher *dispatch.Dispatcher,
 
                defer func() { <-lr.concurrencyLimit }()
 
+               select {
+               case c := <-status:
+                       // Check for state updates after possibly
+                       // waiting to be ready-to-run
+                       if c.Priority == 0 {
+                               goto Finish
+                       }
+               default:
+                       break
+               }
+
                waitGroup.Add(1)
                defer waitGroup.Done()
 
@@ -212,6 +223,8 @@ func (lr *LocalRun) run(dispatcher *dispatch.Dispatcher,
                }
        }
 
+Finish:
+
        // If the container is not finalized, then change it to "Cancelled".
        err := dispatcher.Arv.Get("containers", uuid, nil, &container)
        if err != nil {