runservice scheduler: choose scheduler only if it has capacity
This commit is contained in:
parent
1ac139434e
commit
9c74b4ddc1
|
@ -182,6 +182,9 @@ var defaultConfig = Config{
|
||||||
RunServiceScheduler: RunServiceScheduler{
|
RunServiceScheduler: RunServiceScheduler{
|
||||||
RunCacheExpireInterval: 7 * 24 * time.Hour,
|
RunCacheExpireInterval: 7 * 24 * time.Hour,
|
||||||
},
|
},
|
||||||
|
RunServiceExecutor: RunServiceExecutor{
|
||||||
|
ActiveTasksLimit: 2,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
func Parse(configFile string) (*Config, error) {
|
func Parse(configFile string) (*Config, error) {
|
||||||
|
|
|
@ -293,6 +293,11 @@ func (s *Scheduler) chooseExecutor(ctx context.Context, rct *types.RunConfigTask
|
||||||
if e.Labels["arch"] != string(rct.Runtime.Arch) {
|
if e.Labels["arch"] != string(rct.Runtime.Arch) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
if e.ActiveTasksLimit != 0 {
|
||||||
|
if e.ActiveTasks >= e.ActiveTasksLimit {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return e, nil
|
return e, nil
|
||||||
|
|
Loading…
Reference in New Issue