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