MCPcopy Create free account
hub / github.com/ContentSquare/chproxy / setupReloadConfigWatch

Function setupReloadConfigWatch

main.go:99–114  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

97}
98
99func setupReloadConfigWatch() {
100 c := make(chan os.Signal, 1)
101 signal.Notify(c, syscall.SIGHUP)
102 go func() {
103 for {
104 if <-c == syscall.SIGHUP {
105 log.Infof("SIGHUP received. Going to reload config %s ...", *configFile)
106 if err := reloadConfig(); err != nil {
107 log.Errorf("error while reloading config: %s", err)
108 continue
109 }
110 log.Infof("Reloading config %s: successful", *configFile)
111 }
112 }
113 }()
114}
115
116var autocertManager *autocert.Manager
117

Callers 1

mainFunction · 0.85

Calls 3

InfofFunction · 0.92
ErrorfFunction · 0.92
reloadConfigFunction · 0.85

Tested by

no test coverage detected