去掉常驻任务逻辑

写了再去掉……
This commit is contained in:
郝大全
2017-07-03 17:27:01 +08:00
parent 1300ca1a8b
commit 973e4b766f
9 changed files with 7 additions and 142 deletions

View File

@@ -49,24 +49,3 @@ func runCmdWithTimeout(cmd *exec.Cmd, timeout time.Duration) (error, bool) {
}
}
//func stopCmd(cmd *exec.Cmd) (error,bool) {
// done := make(chan error)
// go func() {
// done <- cmd.Wait()
// }()
//
// var err error
// select {
// case <-time.After(timeout):
// beego.Warn(fmt.Sprintf("任务执行时间超过%d秒进程将被强制杀掉: %d", int(timeout/time.Second), cmd.Process.Pid))
// go func() {
// <-done // 读出上面的goroutine数据避免阻塞导致无法退出
// }()
// if err = cmd.Process.Kill(); err != nil {
// beego.Error(fmt.Sprintf("进程无法杀掉: %d, 错误信息: %s", cmd.Process.Pid, err))
// }
// return err, true
// case err = <-done:
// return err, false
// }
//}