File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
DevProxy.Plugins/Behavior Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -259,7 +259,13 @@ private void FailBatch(ProxyRequestArgs e)
259
259
{
260
260
var retryAfterDate = DateTime . Now . AddSeconds ( Configuration . RetryAfterInSeconds ) ;
261
261
var requestUrl = ProxyUtils . GetAbsoluteRequestUrlFromBatch ( e . Session . HttpClient . Request . RequestUri , request . Url ) ;
262
- var throttledRequests = e . GlobalData [ RetryAfterPlugin . ThrottledRequestsKey ] as List < ThrottlerInfo > ;
262
+
263
+ if ( ! e . GlobalData . TryGetValue ( RetryAfterPlugin . ThrottledRequestsKey , out var value ) )
264
+ {
265
+ value = new List < ThrottlerInfo > ( ) ;
266
+ e . GlobalData . Add ( RetryAfterPlugin . ThrottledRequestsKey , value ) ;
267
+ }
268
+ var throttledRequests = value as List < ThrottlerInfo > ;
263
269
throttledRequests ? . Add ( new ( GraphUtils . BuildThrottleKey ( requestUrl ) , ShouldThrottle , retryAfterDate ) ) ;
264
270
response . Headers = new ( ) { { "Retry-After" , Configuration . RetryAfterInSeconds . ToString ( CultureInfo . InvariantCulture ) } } ;
265
271
}
You can’t perform that action at this time.
0 commit comments