MCPcopy
hub / github.com/github/gh-ost / acceptSignals

Function acceptSignals

go/cmd/gh-ost/main.go:45–62  ·  view source on GitHub ↗

acceptSignals registers for OS signals

(migrationContext *base.MigrationContext)

Source from the content-addressed store, hash-verified

43
44// acceptSignals registers for OS signals
45func acceptSignals(migrationContext *base.MigrationContext) {
46 c := make(chan os.Signal, 1)
47
48 signal.Notify(c, syscall.SIGHUP)
49 go func() {
50 for sig := range c {
51 switch sig {
52 case syscall.SIGHUP:
53 migrationContext.Log.Infof("Received SIGHUP. Reloading configuration")
54 if err := migrationContext.ReadConfigFile(); err != nil {
55 log.Errore(err)
56 } else {
57 migrationContext.MarkPointOfInterest()
58 }
59 }
60 }
61 }()
62}
63
64// main is the application's entry point. It will either spawn a CLI or HTTP interfaces.
65func main() {

Callers 1

mainFunction · 0.85

Calls 4

ReadConfigFileMethod · 0.80
MarkPointOfInterestMethod · 0.80
InfofMethod · 0.65
ErroreMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…