镜像自地址
https://github.com/tuna/tunasync.git
已同步 2025-12-06 06:26:46 +00:00
refactor(worker): use Run instead of Start and Wait
这个提交包含在:
@@ -15,6 +15,8 @@ import (
|
||||
// it's an alternative to python-sh or go-sh
|
||||
// TODO: cgroup excution
|
||||
|
||||
var errProcessNotStarted = errors.New("Process Not Started")
|
||||
|
||||
type cmdJob struct {
|
||||
cmd *exec.Cmd
|
||||
workingDir string
|
||||
@@ -62,11 +64,8 @@ func (c *cmdJob) SetLogFile(logFile *os.File) {
|
||||
}
|
||||
|
||||
func (c *cmdJob) Terminate() error {
|
||||
if c.cmd == nil {
|
||||
return nil
|
||||
}
|
||||
if c.cmd.Process == nil {
|
||||
return nil
|
||||
if c.cmd == nil || c.cmd.Process == nil {
|
||||
return errProcessNotStarted
|
||||
}
|
||||
err := unix.Kill(c.cmd.Process.Pid, syscall.SIGTERM)
|
||||
if err != nil {
|
||||
|
||||
在新工单中引用
屏蔽一个用户