mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-02-20 21:26:18 +00:00
Make sure step passed into go routine exist and does not change (#1903)
just a tiny code improvement
This commit is contained in:
parent
5d72060bbd
commit
94f2331a4c
1 changed files with 8 additions and 7 deletions
|
@ -48,15 +48,16 @@ func start(ctx context.Context, store store.Store, activePipeline *model.Pipelin
|
|||
}
|
||||
|
||||
// open logs streamer for each step
|
||||
go func() {
|
||||
for _, wf := range activePipeline.Workflows {
|
||||
for _, step := range wf.Children {
|
||||
if err := server.Config.Services.Logs.Open(context.Background(), step.ID); err != nil {
|
||||
log.Error().Err(err).Msgf("could not open log stream for step %d", step.ID)
|
||||
for _, wf := range activePipeline.Workflows {
|
||||
for _, step := range wf.Children {
|
||||
stepID := step.ID
|
||||
go func() {
|
||||
if err := server.Config.Services.Logs.Open(context.Background(), stepID); err != nil {
|
||||
log.Error().Err(err).Msgf("could not open log stream for step %d", stepID)
|
||||
}
|
||||
}
|
||||
}()
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
||||
updatePipelineStatus(ctx, activePipeline, repo, user)
|
||||
|
||||
|
|
Loading…
Reference in a new issue