mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-12-20 06:18:56 +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
|
cmd.Dir = c.workDir
|
||||||
}
|
}
|
||||||
|
|
||||||
if c.timeout != 0 {
|
|
||||||
err := cmd.Run()
|
err := cmd.Run()
|
||||||
if c.taskItem != nil {
|
if c.taskItem != nil {
|
||||||
customWriter.Flush()
|
customWriter.Flush()
|
||||||
}
|
}
|
||||||
|
if c.timeout != 0 {
|
||||||
if ctx != nil && errors.Is(ctx.Err(), context.DeadlineExceeded) {
|
if ctx != nil && errors.Is(ctx.Err(), context.DeadlineExceeded) {
|
||||||
return "", buserr.New("ErrCmdTimeout")
|
return "", buserr.New("ErrCmdTimeout")
|
||||||
}
|
}
|
||||||
if err != nil {
|
|
||||||
|
|
||||||
return handleErr(stdout, stderr, c.IgnoreExist1, err)
|
|
||||||
}
|
}
|
||||||
return stdout.String(), nil
|
|
||||||
}
|
|
||||||
|
|
||||||
err := cmd.Run()
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return handleErr(stdout, stderr, c.IgnoreExist1, err)
|
return handleErr(stdout, stderr, c.IgnoreExist1, err)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue