File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change 4
4
using System . Linq ;
5
5
using System . Net ;
6
6
using System . Reflection ;
7
+ using System . Runtime . CompilerServices ;
7
8
using System . Text ;
8
9
using System . Threading ;
9
10
using System . Web ;
@@ -137,6 +138,7 @@ public JToken ExecuteRequest(HttpWebRequest request)
137
138
138
139
}
139
140
141
+ [ MethodImpl ( MethodImplOptions . Synchronized ) ]
140
142
private static void EnforceRateLimit ( )
141
143
{
142
144
switch ( RateLimit )
@@ -154,6 +156,7 @@ private static void EnforceRateLimit()
154
156
while ( ( DateTime . UtcNow - _burstStart ) . TotalSeconds < 10 )
155
157
Thread . Sleep ( 250 ) ;
156
158
_burstStart = DateTime . UtcNow ;
159
+ _requestsThisBurst = 0 ;
157
160
}
158
161
_requestsThisBurst ++ ;
159
162
break ;
@@ -165,6 +168,7 @@ private static void EnforceRateLimit()
165
168
while ( ( DateTime . UtcNow - _burstStart ) . TotalSeconds < 60 )
166
169
Thread . Sleep ( 250 ) ;
167
170
_burstStart = DateTime . UtcNow ;
171
+ _requestsThisBurst = 0 ;
168
172
}
169
173
_requestsThisBurst ++ ;
170
174
break ;
You can’t perform that action at this time.
0 commit comments