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> {
|
async getLastValue(name: string): Promise<number | undefined> {
|
||||||
try {
|
const gauge = await this.gauges.get(name)?.gauge?.get();
|
||||||
return (await this.gauges[name].gauge.get()).values[0].value;
|
if (gauge && gauge.values.length > 0) {
|
||||||
} catch (e) {
|
return gauge.values[0].value;
|
||||||
return undefined;
|
|
||||||
}
|
}
|
||||||
|
return undefined;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user