diff --git a/common/task/task.go b/common/task/task.go index e1640eac7..f79e5610a 100644 --- a/common/task/task.go +++ b/common/task/task.go @@ -20,6 +20,11 @@ func (c *executionContext) executeTask() error { return nil } + // Reuse current goroutine if we only have one task to run. + if len(c.tasks) == 1 && c.ctx == nil { + return c.tasks[0]() + } + ctx := context.Background() if c.ctx != nil {