MCPcopy Create free account
hub / github.com/apache/kvrocks-controller / registerSignal

Function registerSignal

cmd/server/main.go:44–55  ·  view source on GitHub ↗
(closeFn func())

Source from the content-addressed store, hash-verified

42}
43
44func registerSignal(closeFn func()) {
45 c := make(chan os.Signal, 1)
46 signal.Notify(c, []os.Signal{syscall.SIGHUP, syscall.SIGINT, syscall.SIGTERM, syscall.SIGUSR1}...)
47 go func() {
48 for sig := range c {
49 if handleSignals(sig) {
50 closeFn()
51 return
52 }
53 }
54 }()
55}
56
57func handleSignals(sig os.Signal) (exitNow bool) {
58 switch sig {

Callers 1

mainFunction · 0.85

Calls 2

handleSignalsFunction · 0.85
NotifyMethod · 0.80

Tested by

no test coverage detected