mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	Use map method
This commit is contained in:
		
							parent
							
								
									d785730087
								
							
						
					
					
						commit
						05762e9b59
					
				@ -42,10 +42,10 @@ export class DbMetricsMonitor {
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    async getLastValue(name: string): Promise<number | undefined> {
 | 
			
		||||
        try {
 | 
			
		||||
            return (await this.gauges[name].gauge.get()).values[0].value;
 | 
			
		||||
        } catch (e) {
 | 
			
		||||
        const gauge = await this.gauges.get(name)?.gauge?.get();
 | 
			
		||||
        if (gauge && gauge.values.length > 0) {
 | 
			
		||||
            return gauge.values[0].value;
 | 
			
		||||
        }
 | 
			
		||||
        return undefined;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user