mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-05-31 18:24:10 +00:00
setRemoteTrafficLocked attempted to INSERT a new central inbound for
every snap whose tag was not in tagToCentral (which is scoped by
node_id). When a different owner — the local panel or another node —
already held the tag, the INSERT tripped the UNIQUE constraint on
inbounds.tag and re-fired on every periodic snap.
Pre-check for tag ownership before the INSERT. If a different owner
holds it, log once per (nodeID, tag) via a sync.Map dedupe and skip
silently from then on. Real DB errors still surface.
Also switch the six setRemoteTraffic warnings from logger.Warning(...)
to logger.Warningf("%q ... %v", ...) — fmt.Sprint only inserts spaces
between adjacent non-string operands, so the all-string call sites
produced runs like "taginbound-443failed:UNIQUE...". Format strings
also let us quote the tag with %q so it stands out from the prose.
|
||
|---|---|---|
| .. | ||
| controller | ||
| entity | ||
| global | ||
| job | ||
| locale | ||
| middleware | ||
| network | ||
| runtime | ||
| service | ||
| session | ||
| translation | ||
| websocket | ||
| web.go | ||