fix(main): remove duplicate ClearTunnelID/State and call telemetry.UpdateSiteInfo after resolving client ID

This commit is contained in:
Marc Schäfer
2025-10-08 00:09:44 +02:00
parent 83c3ae5cf9
commit 09fcb36963

View File

@@ -469,6 +469,8 @@ func main() {
} }
endpoint = client.GetConfig().Endpoint // Update endpoint from config endpoint = client.GetConfig().Endpoint // Update endpoint from config
id = client.GetConfig().ID // Update ID from config id = client.GetConfig().ID // Update ID from config
// Update site labels for metrics with the resolved ID
telemetry.UpdateSiteInfo(id, region)
// output env var values if set // output env var values if set
logger.Debug("Endpoint: %v", endpoint) logger.Debug("Endpoint: %v", endpoint)
@@ -740,12 +742,6 @@ persistent_keepalive_interval=5`, fixKey(privateKey.String()), fixKey(wgData.Pub
state.Global().ClearTunnel(wgData.PublicKey) state.Global().ClearTunnel(wgData.PublicKey)
} }
// Clear metrics attrs and sessions for the tunnel
if pm != nil {
pm.ClearTunnelID()
state.Global().ClearTunnel(wgData.PublicKey)
}
// Mark as disconnected // Mark as disconnected
connected = false connected = false