Skip to content

Commit dc87bd0

Browse files
Fixed telemetry queue shorten calculation on reconfigure. (#1105)
Co-authored-by: Walt Jones <[email protected]>
1 parent 0457504 commit dc87bd0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/telemetry.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ Telemeter.prototype.configure = function(options) {
1515
var maxTelemetryEvents = this.options.maxTelemetryEvents || MAX_EVENTS;
1616
var newMaxEvents = Math.max(0, Math.min(maxTelemetryEvents, MAX_EVENTS));
1717
var deleteCount = 0;
18-
if (this.maxQueueSize > newMaxEvents) {
19-
deleteCount = this.maxQueueSize - newMaxEvents;
18+
if (this.queue.length > newMaxEvents) {
19+
deleteCount = this.queue.length - newMaxEvents;
2020
}
2121
this.maxQueueSize = newMaxEvents;
2222
this.queue.splice(0, deleteCount);

0 commit comments

Comments
 (0)