File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
livekit/src/room/participant Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -740,6 +740,7 @@ impl LocalParticipant {
740740 // This is set to 7 seconds to account for various relay timeouts and retries in LiveKit Cloud that occur in rare cases
741741
742742 let max_round_trip_latency = Duration :: from_millis ( 7000 ) ;
743+ let min_effective_timeout = Duration :: from_millis ( 1000 ) ;
743744
744745 if data. payload . len ( ) > MAX_PAYLOAD_BYTES {
745746 return Err ( RpcError :: built_in ( RpcErrorCode :: RequestPayloadTooLarge , None ) ) ;
@@ -760,7 +761,10 @@ impl LocalParticipant {
760761 let id = create_random_uuid ( ) ;
761762 let ( ack_tx, ack_rx) = oneshot:: channel ( ) ;
762763 let ( response_tx, response_rx) = oneshot:: channel ( ) ;
763- let effective_timeout = data. response_timeout - max_round_trip_latency;
764+ let effective_timeout = std:: cmp:: max (
765+ data. response_timeout . saturating_sub ( max_round_trip_latency) ,
766+ min_effective_timeout,
767+ ) ;
764768
765769 match self
766770 . publish_rpc_request ( RpcRequest {
You can’t perform that action at this time.
0 commit comments