MCPcopy Create free account
hub / github.com/coder/coder / changedConntype

Method changedConntype

tailnet/telemetry.go:105–123  ·  view source on GitHub ↗
(addr string)

Source from the content-addressed store, hash-verified

103}
104
105func (b *TelemetryStore) changedConntype(addr string) bool {
106 b.mu.Lock()
107 defer b.mu.Unlock()
108
109 switch {
110 case b.p2p && addr != "":
111 return false
112 case !b.p2p && addr != "":
113 b.p2p = true
114 b.p2pSetupTime = time.Since(b.lastDerpTime)
115 return true
116 case b.p2p && addr == "":
117 b.p2p = false
118 b.lastDerpTime = time.Now()
119 b.p2pSetupTime = 0
120 return true
121 }
122 return false
123}
124
125func (b *TelemetryStore) updateRemoteNodeIDLocked(nm *netmap.NetworkMap) {
126 if b.connectedIP == nil {

Callers 1

watchConnChangeMethod · 0.80

Calls 2

LockMethod · 0.45
UnlockMethod · 0.45

Tested by

no test coverage detected