You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
returnError<T>(string.Format("You are sending too many requests and are being rate limited for %d seconds. Call was to endpoint %s",secondsLeftOfRateLimit,method));
160
+
returnError<T>(string.Format("Your request to %s was not sent. You are sending too many requests and are being rate limited for %d seconds",method,secondsLeftOfRateLimit));
161
161
}
162
162
}
163
163
@@ -170,7 +170,7 @@ public class RateLimiter
170
170
/* -- Configurable constants -- */
171
171
// Tripwire settings, allow for a max total of n requests per x seconds
172
172
protectedconstintTripWireTimeFrameSeconds=60;
173
-
protectedconstintMaxRequestsPerTripWireTimeFrame=280;// The backend rate limit is 300 requests per minute so we'll limit it slightly before that
protectedconstintSecondsPerBucket=5;// Needs to evenly divide the time frame
175
175
176
176
// Moving average settings, allow for a max average of n requests per x seconds
@@ -253,8 +253,8 @@ public virtual bool AddRequestAndCheckIfRateLimitHit()
253
253
isRateLimited|=_totalRequestsInBucketsInTripWireTimeFrame>=MaxRequestsPerTripWireTimeFrame;// If the request count for the time frame is greater than the max requests per time frame, set isRateLimited to true
254
254
isRateLimited|=_totalRequestsInBuckets/RateLimitMovingAverageBucketCount>MaxRequestsPerBucketOnMovingAverage;// If the average number of requests per bucket is greater than the max requests on moving average, set isRateLimited to true
255
255
#if UNITY_EDITOR
256
-
if(_totalRequestsInBucketsInTripWireTimeFrame>=MaxRequestsPerTripWireTimeFrame)Debug.Log("Rate Limit Hit due to Trip Wire, count = "+_totalRequestsInBucketsInTripWireTimeFrame+" out of allowed "+MaxRequestsPerTripWireTimeFrame);
257
-
if(_totalRequestsInBuckets/RateLimitMovingAverageBucketCount>MaxRequestsPerBucketOnMovingAverage)Debug.Log("Rate Limit Hit due to Moving Average, count = "+_totalRequestsInBuckets/RateLimitMovingAverageBucketCount+" out of allowed "+MaxRequestsPerBucketOnMovingAverage);
256
+
if(_totalRequestsInBucketsInTripWireTimeFrame>=MaxRequestsPerTripWireTimeFrame)LootLockerLogger.GetForLogLevel()("Rate Limit Hit due to Trip Wire, count = "+_totalRequestsInBucketsInTripWireTimeFrame+" out of allowed "+MaxRequestsPerTripWireTimeFrame);
257
+
if(_totalRequestsInBuckets/RateLimitMovingAverageBucketCount>MaxRequestsPerBucketOnMovingAverage)LootLockerLogger.GetForLogLevel()("Rate Limit Hit due to Moving Average, count = "+_totalRequestsInBuckets/RateLimitMovingAverageBucketCount+" out of allowed "+MaxRequestsPerBucketOnMovingAverage);
0 commit comments