executor: don't start task if max tasks limit has been reached

This commit is contained in:
Simone Gotti 2019-05-15 15:06:46 +02:00
parent e2bee03a06
commit 821e371cd8
1 changed files with 7 additions and 0 deletions

View File

@ -753,6 +753,13 @@ func (e *Executor) executeTask(ctx context.Context, et *types.ExecutorTask) {
return
}
activeTasks := e.runningTasks.len()
// don't start task if we have reached the active tasks limit
// they will be executed later
if activeTasks > e.c.ActiveTasksLimit {
return
}
rt := &runningTask{
et: et,
}