mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-10-16 10:27:05 +08:00
fix: Optimize script-type cronjob execution output (#9326)
This commit is contained in:
parent
be6d3ea337
commit
7889b5ad69
1 changed files with 4 additions and 11 deletions
|
@ -136,22 +136,15 @@ func (c *CommandHelper) run(name string, arg ...string) (string, error) {
|
|||
cmd.Dir = c.workDir
|
||||
}
|
||||
|
||||
err := cmd.Run()
|
||||
if c.taskItem != nil {
|
||||
customWriter.Flush()
|
||||
}
|
||||
if c.timeout != 0 {
|
||||
err := cmd.Run()
|
||||
if c.taskItem != nil {
|
||||
customWriter.Flush()
|
||||
}
|
||||
if ctx != nil && errors.Is(ctx.Err(), context.DeadlineExceeded) {
|
||||
return "", buserr.New("ErrCmdTimeout")
|
||||
}
|
||||
if err != nil {
|
||||
|
||||
return handleErr(stdout, stderr, c.IgnoreExist1, err)
|
||||
}
|
||||
return stdout.String(), nil
|
||||
}
|
||||
|
||||
err := cmd.Run()
|
||||
if err != nil {
|
||||
return handleErr(stdout, stderr, c.IgnoreExist1, err)
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue