From 182f0f2c64f3e5f4ad07e736ab47379d56b4d9e5 Mon Sep 17 00:00:00 2001 From: Christoph Kluge Date: Tue, 8 Oct 2024 10:42:13 +0200 Subject: [PATCH] fix: add missing default resolution case --- internal/graph/schema.resolvers.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/internal/graph/schema.resolvers.go b/internal/graph/schema.resolvers.go index bde7013e..14f71e15 100644 --- a/internal/graph/schema.resolvers.go +++ b/internal/graph/schema.resolvers.go @@ -268,9 +268,15 @@ func (r *queryResolver) Job(ctx context.Context, id string) (*schema.Job, error) // JobMetrics is the resolver for the jobMetrics field. func (r *queryResolver) JobMetrics(ctx context.Context, id string, metrics []string, scopes []schema.MetricScope, resolution *int) ([]*model.JobMetricWithName, error) { - if resolution == nil && config.Keys.EnableResampling != nil { - defaultRes := slices.Max(config.Keys.EnableResampling.Resolutions) - resolution = &defaultRes + + if resolution == nil { // Load from Config + if config.Keys.EnableResampling != nil { + defaultRes := slices.Max(config.Keys.EnableResampling.Resolutions) + resolution = &defaultRes + } else { // Set 0 (Loads configured metric timestep) + defaultRes := 0 + resolution = &defaultRes + } } job, err := r.Query().Job(ctx, id)