File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed
Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -856,9 +856,9 @@ def throttled(self):
856856 """
857857 Return True if we are connected but currently throttled.
858858 """
859- if self .state is ConnectionStates .CONNECTED :
860- return self . _throttle_time is not None and self . _throttle_time > time . time ()
861- return False
859+ if self .state is not ConnectionStates .CONNECTED :
860+ return False
861+ return self . throttle_delay () > 0
862862
863863 def throttle_delay (self ):
864864 """
@@ -1105,11 +1105,8 @@ def _maybe_throttle(self, response):
11051105
11061106 def can_send_more (self ):
11071107 """Check for throttling / quota violations and max in-flight-requests"""
1108- if self ._throttle_time is not None :
1109- if self ._throttle_time > time .time ():
1110- return False
1111- # Reset throttle_time if needed
1112- self ._throttle_time = None
1108+ if self .throttle_delay () > 0 :
1109+ return False
11131110 max_ifrs = self .config ['max_in_flight_requests_per_connection' ]
11141111 return len (self .in_flight_requests ) < max_ifrs
11151112
You can’t perform that action at this time.
0 commit comments