@brightspace-ui/logging
Advanced tools
Comparing version
@@ -245,10 +245,5 @@ const _isFiniteNumber = (val) => val !== null && isFinite(val) && !isNaN(val); | ||
// rate limit number of errors to 100 per minute | ||
let sliceIndex = this._logTimestamps.length; | ||
for (let i = 0; i < this._logTimestamps.length; i++) { | ||
if (this._logTimestamps[i] >= (now - MAXIMUM_LOGS_TIME_SPAN)) { | ||
sliceIndex = i; | ||
break; | ||
} | ||
while (this._logTimestamps.length > 0 && this._logTimestamps[0] < (now - MAXIMUM_LOGS_TIME_SPAN)) { | ||
this._logTimestamps.shift(); | ||
} | ||
this._logTimestamps = this._logTimestamps.slice(sliceIndex); | ||
if (this._logTimestamps.length >= MAXIMUM_LOGS_PER_TIME_SPAN) { | ||
@@ -255,0 +250,0 @@ console.warn(`Logging rate limit of ${MAXIMUM_LOGS_PER_TIME_SPAN} reached in timespan of ${MAXIMUM_LOGS_TIME_SPAN}ms`); |
{ | ||
"name": "@brightspace-ui/logging", | ||
"version": "1.7.0", | ||
"version": "1.7.1", | ||
"description": "JavaScript client for sending logs to the Brightspace Logging service.", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/BrightspaceUI/logging.git", |
56297
-0.24%1006
-0.49%