mirror of https://github.com/jetkvm/kvm.git
fix: prevent timeout ping-pong loop in emergency promotions
This commit is contained in:
parent
906c5cf4b7
commit
d7a37b5eb3
|
|
@ -1223,11 +1223,11 @@ func (sm *SessionManager) transferPrimaryRole(fromSessionID, toSessionID, transf
|
||||||
return fmt.Errorf("cannot promote: another primary session exists (%s)", existingPrimaryID)
|
return fmt.Errorf("cannot promote: another primary session exists (%s)", existingPrimaryID)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Promote target session
|
|
||||||
toSession.Mode = SessionModePrimary
|
toSession.Mode = SessionModePrimary
|
||||||
toSession.hidRPCAvailable = false
|
toSession.hidRPCAvailable = false
|
||||||
// For manual transfers, preserve the session's actual LastActive timestamp
|
if transferType == "emergency_timeout_promotion" {
|
||||||
// Emergency promotions inherit the observer's activity state - no free time
|
toSession.LastActive = time.Now()
|
||||||
|
}
|
||||||
sm.primarySessionID = toSessionID
|
sm.primarySessionID = toSessionID
|
||||||
|
|
||||||
// ALWAYS set lastPrimaryID to the new primary to support WebRTC reconnections
|
// ALWAYS set lastPrimaryID to the new primary to support WebRTC reconnections
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue