diff options
author | Valery Piashchynski <[email protected]> | 2019-11-30 22:47:16 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2019-11-30 22:47:16 +0300 |
commit | 4c608506dd745a73b5e09348485e48288824b774 (patch) | |
tree | 448040cb78f91971259a54654f640e90428ef9a2 /worker.go | |
parent | e8d7453da6a2f29bea56a606e42c18422eb014b0 (diff) |
- Updated worker, add different wait mechanism
Diffstat (limited to 'worker.go')
-rw-r--r-- | worker.go | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -10,6 +10,7 @@ import ( "strconv" "strings" "sync" + "syscall" "time" ) @@ -105,8 +106,13 @@ func (w *Worker) Wait() error { if runtime.GOOS != "windows" { // windows handles processes and close pipes differently, // we can ignore wait here as process.Wait() already being handled above - err := w.cmd.Wait() + var ws syscall.WaitStatus + _, err := syscall.Wait4(w.cmd.Process.Pid, &ws, syscall.WALL, nil) if err != nil { + if ws.Exited() { + return nil + } + } else { return err } } |