MCPcopy
hub / github.com/cloudflare/cloudflared / handleConfigUpdate

Method handleConfigUpdate

cmd/cloudflared/app_service.go:67–84  ·  view source on GitHub ↗
(c config.Root)

Source from the content-addressed store, hash-verified

65}
66
67func (s *AppService) handleConfigUpdate(c config.Root) {
68 // handle the client forward listeners
69 activeServices := map[string]struct{}{}
70 for _, f := range c.Forwarders {
71 service := NewForwardService(f, s.log)
72 s.serviceManager.Add(service)
73 activeServices[service.Name()] = struct{}{}
74 }
75
76 // TODO: TUN-1451 - tunnels
77
78 // remove any services that are no longer active
79 for _, service := range s.serviceManager.Services() {
80 if _, ok := activeServices[service.Name()]; !ok {
81 s.serviceManager.Remove(service.Name())
82 }
83 }
84}

Callers 1

actionLoopMethod · 0.95

Calls 5

NewForwardServiceFunction · 0.85
AddMethod · 0.65
NameMethod · 0.65
ServicesMethod · 0.65
RemoveMethod · 0.65

Tested by

no test coverage detected