修复 gin框架一直wait的问题

This commit is contained in:
dengsgo 2019-06-04 10:52:58 +08:00
parent 8181a8f0c5
commit 281a4f4d64

View File

@ -45,7 +45,14 @@ func (t *TaskMan) Put(cf *changedFile) {
}
func (t *TaskMan) preRun(cf *changedFile) {
if t.cmd != nil && t.cmd.Process != nil && t.cmd.ProcessState != nil && !t.cmd.ProcessState.Exited() {
log.Println("preRun ...", t.cmd)
log.Println(t.cmd != nil)
if t.cmd != nil {
log.Println(t.cmd.Process != nil)
//log.Println(t.cmd.ProcessState != nil)
//log.Println(!t.cmd.ProcessState.Exited())
}
if t.cmd != nil && t.cmd.Process != nil {
log.Println("stop old process ")
if err := t.cmd.Process.Kill(); err != nil {
log.Println(PreWarn, "stopped err, reason:", err)