From 281a4f4d64f0b2a7f0ba2b43101db3554c40c7cf Mon Sep 17 00:00:00 2001 From: dengsgo Date: Tue, 4 Jun 2019 10:52:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20gin=E6=A1=86=E6=9E=B6?= =?UTF-8?q?=E4=B8=80=E7=9B=B4wait=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- taskman.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/taskman.go b/taskman.go index 7b237db..a4747f8 100644 --- a/taskman.go +++ b/taskman.go @@ -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)