MCPcopy
hub / github.com/perkeep/perkeep / Quit

Method Quit

pkg/server/app/app.go:533–551  ·  view source on GitHub ↗

Quit sends the app's process a SIGINT, and waits up to 5 seconds for it to exit, returning an error if it doesn't.

()

Source from the content-addressed store, hash-verified

531// Quit sends the app's process a SIGINT, and waits up to 5 seconds for it
532// to exit, returning an error if it doesn't.
533func (a *Handler) Quit() error {
534 err := a.process.Signal(os.Interrupt)
535 if err != nil {
536 return err
537 }
538
539 c := make(chan error)
540 go func() {
541 _, err := a.process.Wait()
542 c <- err
543 }()
544 select {
545 case err = <-c:
546 case <-time.After(5 * time.Second):
547 // TODO Do we want to SIGKILL here or just leave the app alone?
548 err = errProcessTookTooLong
549 }
550 return err
551}

Callers 2

TestQuitFunction · 0.95
serveRestartMethod · 0.80

Calls 1

WaitMethod · 0.80

Tested by 1

TestQuitFunction · 0.76