From f9dfdf862b1292e26c022ef9634a8b009015200c Mon Sep 17 00:00:00 2001 From: remoterami Date: Mon, 5 Aug 2024 09:52:35 +0200 Subject: [PATCH] using hours instead of days in overview --- backend/pkg/api/data_access/vdb_management.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/backend/pkg/api/data_access/vdb_management.go b/backend/pkg/api/data_access/vdb_management.go index 04c77e0d2..28e9aa278 100644 --- a/backend/pkg/api/data_access/vdb_management.go +++ b/backend/pkg/api/data_access/vdb_management.go @@ -312,10 +312,10 @@ func (d *DataAccessService) GetValidatorDashboardOverview(ctx context.Context, d WHERE validator_index = ANY($1)` } - retrieveRewardsAndEfficiency := func(table string, days int, rewards *t.ClElValue[decimal.Decimal], apr *t.ClElValue[float64], efficiency *float64) { + retrieveRewardsAndEfficiency := func(table string, hours int, rewards *t.ClElValue[decimal.Decimal], apr *t.ClElValue[float64], efficiency *float64) { // Rewards + APR wg.Go(func() error { - (*rewards).El, (*apr).El, (*rewards).Cl, (*apr).Cl, err = d.internal_getElClAPR(ctx, dashboardId, -1, days) + (*rewards).El, (*apr).El, (*rewards).Cl, (*apr).Cl, err = d.internal_getElClAPR(ctx, dashboardId, -1, hours) if err != nil { return err } @@ -345,9 +345,9 @@ func (d *DataAccessService) GetValidatorDashboardOverview(ctx context.Context, d }) } - retrieveRewardsAndEfficiency("validator_dashboard_data_rolling_daily", 1, &data.Rewards.Last24h, &data.Apr.Last24h, &data.Efficiency.Last24h) - retrieveRewardsAndEfficiency("validator_dashboard_data_rolling_weekly", 7, &data.Rewards.Last7d, &data.Apr.Last7d, &data.Efficiency.Last7d) - retrieveRewardsAndEfficiency("validator_dashboard_data_rolling_monthly", 30, &data.Rewards.Last30d, &data.Apr.Last30d, &data.Efficiency.Last30d) + retrieveRewardsAndEfficiency("validator_dashboard_data_rolling_daily", 24, &data.Rewards.Last24h, &data.Apr.Last24h, &data.Efficiency.Last24h) + retrieveRewardsAndEfficiency("validator_dashboard_data_rolling_weekly", 7*24, &data.Rewards.Last7d, &data.Apr.Last7d, &data.Efficiency.Last7d) + retrieveRewardsAndEfficiency("validator_dashboard_data_rolling_monthly", 30*24, &data.Rewards.Last30d, &data.Apr.Last30d, &data.Efficiency.Last30d) retrieveRewardsAndEfficiency("validator_dashboard_data_rolling_total", -1, &data.Rewards.AllTime, &data.Apr.AllTime, &data.Efficiency.AllTime) err = wg.Wait()