Additional closure reasons (#958)

This commit is contained in:
David Zhao
2022-08-25 19:36:47 -07:00
committed by GitHub
parent 7ad8f87a52
commit 747089a005
+8
View File
@@ -81,6 +81,8 @@ const (
ParticipantCloseReasonSimulateNodeFailure
ParticipantCloseReasonSimulateServerLeave
ParticipantCloseReasonNegotiateFailed
ParticipantCloseReasonMigrationRequested
ParticipantCloseReasonOvercommitted
)
func (p ParticipantCloseReason) String() string {
@@ -121,6 +123,10 @@ func (p ParticipantCloseReason) String() string {
return "SIMULATE_SERVER_LEAVE"
case ParticipantCloseReasonNegotiateFailed:
return "NEGOTIATE_FAILED"
case ParticipantCloseReasonOvercommitted:
return "OVERCOMMITTED"
case ParticipantCloseReasonMigrationRequested:
return "MIGRATION_REQUESTED"
default:
return fmt.Sprintf("%d", int(p))
}
@@ -149,6 +155,8 @@ func (p ParticipantCloseReason) ToDisconnectReason() livekit.DisconnectReason {
return livekit.DisconnectReason_SERVER_SHUTDOWN
case ParticipantCloseReasonSimulateServerLeave:
return livekit.DisconnectReason_SERVER_SHUTDOWN
case ParticipantCloseReasonOvercommitted:
return livekit.DisconnectReason_SERVER_SHUTDOWN
case ParticipantCloseReasonNegotiateFailed:
return livekit.DisconnectReason_STATE_MISMATCH
default: