MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / InstallShutdownSignalHandlers

Function InstallShutdownSignalHandlers

pkg/util/sigutil/sigutil.go:15–27  ·  view source on GitHub ↗
(doShutdown func(string))

Source from the content-addressed store, hash-verified

13)
14
15func InstallShutdownSignalHandlers(doShutdown func(string)) {
16 sigCh := make(chan os.Signal, 1)
17 signal.Notify(sigCh, syscall.SIGHUP, syscall.SIGTERM, syscall.SIGINT)
18 go func() {
19 defer func() {
20 panichandler.PanicHandler("InstallShutdownSignalHandlers", recover())
21 }()
22 for sig := range sigCh {
23 doShutdown(fmt.Sprintf("got signal %v", sig))
24 break
25 }
26 }()
27}

Callers 1

mainFunction · 0.92

Calls 2

PanicHandlerFunction · 0.92
doShutdownFunction · 0.85

Tested by

no test coverage detected