mirror of
https://github.com/go-gitea/gitea.git
synced 2026-08-31 10:09:39 +09:00
fix(process): reap entire process group on cmd.Cancel (#39143)
Signed-off-by: Royce Remer <royceremer@gmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
co-authored by
wxiaoguang
parent
88974d2db9
commit
eea03676d3
@@ -0,0 +1,19 @@
|
||||
// Copyright 2026 The Gitea Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package process
|
||||
|
||||
import "os/exec"
|
||||
|
||||
// There is no graceful way to kill a process on Windows at the moment
|
||||
|
||||
func setSysProcAttribute(cmd *exec.Cmd) {}
|
||||
|
||||
func (c *Cmd) onCancel() error {
|
||||
if c.onCancelUserFunc != nil {
|
||||
if err := c.onCancelUserFunc(); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return c.Process.Kill()
|
||||
}
|
||||
Reference in New Issue
Block a user