mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-20 00:08:02 +01:00
fix error on empty metrics
This commit is contained in:
parent
b5e2563bbb
commit
5b41bf4b84
@ -1,4 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
const POLL_INTERVAL = 10000;
|
||||
|
||||
module.exports = class UnleashClientMetrics {
|
||||
@ -14,8 +15,10 @@ module.exports = class UnleashClientMetrics {
|
||||
|
||||
addMetrics (metrics) {
|
||||
metrics.forEach(m => this.metrics.push(m));
|
||||
if (this.metrics && this.metrics.length > 0) {
|
||||
this.highestIdSeen = this.metrics[this.metrics.length - 1].id;
|
||||
}
|
||||
}
|
||||
|
||||
startPoller () {
|
||||
setInterval(() => {
|
||||
|
Loading…
Reference in New Issue
Block a user