mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-06-05 20:54:14 +00:00
fix: extend online client grace period to survive idle poll cycles
The 5s grace period equalled the traffic-poll interval, so a client whose Xray stats reported a zero delta for one cycle was still dropped on the very next tick. Bump to 20s (~4 polls) so idle-but-connected sessions stay visible across momentary counter gaps without lingering long after a real disconnect. Refs #4384
This commit is contained in:
parent
e5778b120c
commit
a84c24dbfd
1 changed files with 6 additions and 1 deletions
|
|
@ -1516,7 +1516,12 @@ func (s *InboundService) UpdateInboundClient(data *model.Inbound, clientId strin
|
|||
|
||||
const resetGracePeriodMs int64 = 30000
|
||||
|
||||
const onlineGracePeriodMs int64 = 5000
|
||||
// onlineGracePeriodMs must comfortably exceed the 5s traffic-poll interval —
|
||||
// Xray's stats counters often report a zero delta for an active session across
|
||||
// a single poll, so a 5s grace would still drop the client on the next tick.
|
||||
// ~4 polls of slack keeps idle-but-connected clients visible without lingering
|
||||
// long after a real disconnect.
|
||||
const onlineGracePeriodMs int64 = 20000
|
||||
|
||||
func (s *InboundService) SetRemoteTraffic(nodeID int, snap *runtime.TrafficSnapshot) (bool, error) {
|
||||
var structuralChange bool
|
||||
|
|
|
|||
Loading…
Reference in a new issue