MCPcopy Index your code
hub / github.com/cloudflare/cloudflared / WatcherItemDidChange

Method WatcherItemDidChange

config/manager.go:99–107  ·  view source on GitHub ↗

File change notifications from the watcher WatcherItemDidChange triggers when the yaml config is updated sends the updated config to the service to reload its state

(filepath string)

Source from the content-addressed store, hash-verified

97// WatcherItemDidChange triggers when the yaml config is updated
98// sends the updated config to the service to reload its state
99func (m *FileManager) WatcherItemDidChange(filepath string) {
100 config, err := m.GetConfig()
101 if err != nil {
102 m.log.Err(err).Msg("Failed to read new config")
103 return
104 }
105 m.log.Info().Msg("Config file has been updated")
106 m.notifier.ConfigDidUpdate(config)
107}
108
109// WatcherDidError notifies of errors with the file watcher
110func (m *FileManager) WatcherDidError(err error) {

Callers

nothing calls this directly

Calls 3

GetConfigMethod · 0.95
ConfigDidUpdateMethod · 0.65
ErrMethod · 0.45

Tested by

no test coverage detected