We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0b21469 commit 1d5c2efCopy full SHA for 1d5c2ef
godemon.go
@@ -411,8 +411,23 @@ func (c *Cmd) Shutdown(s syscall.Signal) error {
411
c.willShutdown = true
412
c.Signal(s)
413
debugf("Shutdown: signaled command, now waiting for termination")
414
+ doneCh := make(chan struct{})
415
+ defer close(doneCh)
416
+ go func() {
417
+ delay := 500 * time.Millisecond
418
+ for {
419
+ select {
420
+ case <-time.After(delay):
421
+ debugf("Command is still running - signaling again (pid %d)", c.Process.Pid)
422
+ c.Signal(s)
423
+ delay *= 2
424
+ case <-doneCh:
425
+ return
426
+ }
427
428
+ }()
429
err := c.Wait()
- debugf("Wait() error: %s", err)
430
+ debugf("Wait() error: %v", err)
431
return err
432
}
433
0 commit comments