File tree Expand file tree Collapse file tree 2 files changed +2
-5
lines changed Expand file tree Collapse file tree 2 files changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ class PingUploader implements PingsDatabaseObserver {
9898 platform : Platform ,
9999 private readonly pingsDatabase = Context . pingsDatabase ,
100100 private readonly policy = new Policy ( ) ,
101- private readonly rateLimiter = new RateLimiter ( RATE_LIMITER_INTERVAL , MAX_PINGS_PER_INTERVAL )
101+ private readonly rateLimiter = new RateLimiter ( RATE_LIMITER_INTERVAL_MS , MAX_PINGS_PER_INTERVAL )
102102 ) {
103103 this . processing = [ ] ;
104104 // Initialize the ping uploader with either the platform defaults or a custom
Original file line number Diff line number Diff line change @@ -13,9 +13,6 @@ export const enum RateLimiterState {
1313 // The RateLimiter has not reached the maximum count, but it is also not incrementing.
1414 Stopped ,
1515 // The RateLimiter has reached the maximum count for the current interval.
16- //
17- // This variant contains the remaining time (in milliseconds)
18- // until the rate limiter is not throttled anymore.
1916 Throttled ,
2017}
2118
@@ -62,7 +59,7 @@ class RateLimiter {
6259 /**
6360 * The rate limiter should reset if
6461 *
65- * 1. It has never started;
62+ * 1. It has never started i.e. `started` is still `undefined` ;
6663 * 2. It has been started more than the interval time ago;
6764 * 3. Something goes wrong while trying to calculate the elapsed time since the last reset.
6865 *
You can’t perform that action at this time.
0 commit comments