File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -594,9 +594,16 @@ def blacked_out(self):
594
594
return False
595
595
596
596
def connection_delay (self ):
597
- time_waited_ms = time .time () - (self .last_attempt or 0 )
597
+ """
598
+ Return the number of milliseconds to wait, based on the connection
599
+ state, before attempting to send data. When disconnected, this respects
600
+ the reconnect backoff time. When connecting, returns 0 to allow
601
+ non-blocking connect to finish. When connected, returns a very large
602
+ number to handle slow/stalled connections.
603
+ """
604
+ time_waited = time .time () - (self .last_attempt or 0 )
598
605
if self .state is ConnectionStates .DISCONNECTED :
599
- return max (self ._reconnect_backoff - time_waited_ms , 0 )
606
+ return max (self ._reconnect_backoff - time_waited , 0 ) * 1000
600
607
elif self .connecting ():
601
608
return 0
602
609
else :
You can’t perform that action at this time.
0 commit comments