Skip to content

Commit 268feaf

Browse files
committed
Attend to review comments
1 parent 2bd1e98 commit 268feaf

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

glean/src/core/upload/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

glean/src/core/upload/rate_limiter.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff 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
*

0 commit comments

Comments
 (0)