MCPcopy Create free account
hub / github.com/DBCDK/morph / SignalHandler

Function SignalHandler

utils/finalizer.go:43–51  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

41}
42
43func SignalHandler() {
44 sigs := make(chan os.Signal, 1)
45 signal.Notify(sigs, syscall.SIGINT, syscall.SIGTERM)
46 go func() {
47 sig := <-sigs
48 fmt.Fprintf(os.Stderr, "Received signal: %s\n", sig.String())
49 Exit(130) // reserved exit code for "Interrupted"
50 }()
51}
52
53func Exit(exitCode int) {
54 RunFinalizers()

Callers 1

setupFunction · 0.92

Calls 2

ExitFunction · 0.85
StringMethod · 0.80

Tested by

no test coverage detected