Merge branch '20264-trusted-clients-portnumber'
[arvados.git] / lib / dispatchcloud / dispatcher.go
index 3403c50c972987e7f6f21a927a6db592fac9f6fc..06a558d5fe2b58c7b9acf149faba020fc8f16c4e 100644 (file)
@@ -193,7 +193,11 @@ func (disp *dispatcher) run() {
        if pollInterval <= 0 {
                pollInterval = defaultPollInterval
        }
-       sched := scheduler.New(disp.Context, disp.queue, disp.pool, disp.Registry, staleLockTimeout, pollInterval)
+       maxSupervisors := int(float64(disp.Cluster.Containers.CloudVMs.MaxInstances) * disp.Cluster.Containers.CloudVMs.SupervisorFraction)
+       if maxSupervisors == 0 && disp.Cluster.Containers.CloudVMs.SupervisorFraction > 0 {
+               maxSupervisors = 1
+       }
+       sched := scheduler.New(disp.Context, disp.ArvClient, disp.queue, disp.pool, disp.Registry, staleLockTimeout, pollInterval, maxSupervisors)
        sched.Start()
        defer sched.Stop()