1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00

fix: should wait for seen apps

This commit is contained in:
Ivar Conradi Østhus 2021-02-04 15:54:29 +01:00
parent 806ecf7385
commit 9607ebce75
No known key found for this signature in database
GPG Key ID: 31AC596886B0BD09

View File

@ -27,23 +27,24 @@ class MetricsController extends Controller {
this.get('/applications/:appName', this.getApplication);
}
getSeenToggles(req, res) {
const seenAppToggles = this.metrics.getAppsWithToggles();
async getSeenToggles(req, res) {
const seenAppToggles = await this.metrics.getAppsWithToggles();
res.json(seenAppToggles);
}
async getSeenApps(req, res) {
const seenApps = this.metrics.getSeenApps();
const seenApps = await this.metrics.getSeenApps();
res.json(seenApps);
}
getFeatureToggles(req, res) {
res.json(this.metrics.getTogglesMetrics());
async getFeatureToggles(req, res) {
const toggles = await this.metrics.getTogglesMetrics();
res.json(toggles);
}
getFeatureToggle(req, res) {
async getFeatureToggle(req, res) {
const { name } = req.params;
const data = this.metrics.getTogglesMetrics();
const data = await this.metrics.getTogglesMetrics();
const lastHour = data.lastHour[name] || {};
const lastMinute = data.lastMinute[name] || {};
res.json({