MCPcopy Index your code
hub / github.com/1Panel-dev/1Panel / waitPipeCommands

Function waitPipeCommands

agent/utils/cmd/cmdx.go:283–301  ·  view source on GitHub ↗
(ctx context.Context, cmds []*exec.Cmd)

Source from the content-addressed store, hash-verified

281}
282
283func waitPipeCommands(ctx context.Context, cmds []*exec.Cmd) error {
284 done := make(chan error, 1)
285 go func() {
286 var runErr error
287 for _, item := range cmds {
288 if err := item.Wait(); err != nil && runErr == nil {
289 runErr = err
290 }
291 }
292 done <- runErr
293 }()
294 select {
295 case runErr := <-done:
296 return runErr
297 case <-ctx.Done():
298 killProcessGroups(cmds)
299 return <-done
300 }
301}
302
303func (c *CommandHelper) run(name string, arg ...string) (string, error) {
304 var cmd *exec.Cmd

Callers 2

RunPipeMethod · 0.70
RunPipeToFileMethod · 0.70

Calls 2

killProcessGroupsFunction · 0.70
WaitMethod · 0.45

Tested by

no test coverage detected