1
0
Fork 0
mirror of https://code.forgejo.org/forgejo/runner.git synced 2025-08-11 17:50:58 +00:00

code complexity of NewPlanExecutor

Signed-off-by: Casey Lee <cplee@nektos.com>
This commit is contained in:
Casey Lee 2020-02-17 10:30:52 -08:00
parent 313692014a
commit bdb0c35ba3
2 changed files with 15 additions and 9 deletions

View file

@ -50,15 +50,7 @@ func New(runnerConfig *Config) (Runner, error) {
}
func (runner *runnerImpl) NewPlanExecutor(plan *model.Plan) common.Executor {
maxJobNameLen := 0
for _, stage := range plan.Stages {
for _, run := range stage.Runs {
jobNameLen := len(run.String())
if jobNameLen > maxJobNameLen {
maxJobNameLen = jobNameLen
}
}
}
maxJobNameLen := plan.MaxRunNameLen()
pipeline := make([]common.Executor, 0)
for _, stage := range plan.Stages {