From 19702fa11091490586584febea0c35547dc34724 Mon Sep 17 00:00:00 2001 From: ptrus Date: Mon, 9 Dec 2024 15:25:35 +0100 Subject: [PATCH] analyer/aggregate_stats: fix errors check --- .changelog/822.trivial.md | 0 analyzer/aggregate_stats/aggregate_stats.go | 6 +++--- 2 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 .changelog/822.trivial.md diff --git a/.changelog/822.trivial.md b/.changelog/822.trivial.md new file mode 100644 index 000000000..e69de29bb diff --git a/analyzer/aggregate_stats/aggregate_stats.go b/analyzer/aggregate_stats/aggregate_stats.go index 404797bb8..bb71e6f5d 100644 --- a/analyzer/aggregate_stats/aggregate_stats.go +++ b/analyzer/aggregate_stats/aggregate_stats.go @@ -206,14 +206,14 @@ func (a *aggregateStatsAnalyzer) aggregateStatsWorker(ctx context.Context) { switch { case err == nil: // Continues below. - case errors.Is(pgx.ErrNoRows, err): + case errors.Is(err, pgx.ErrNoRows): // No stats yet. Start at the earliest indexed block. var earliestBlockTs *time.Time earliestBlockTs, err = a.earliestBlockTs(statCtx, statsComputation.layer) switch { case err == nil: latestComputed = floorWindow(earliestBlockTs) - case errors.Is(pgx.ErrNoRows, err): + case errors.Is(err, pgx.ErrNoRows): // No data log a debug only log. logger.Debug("no stats available yet, skipping iteration") cancel() @@ -234,7 +234,7 @@ func (a *aggregateStatsAnalyzer) aggregateStatsWorker(ctx context.Context) { switch { case err == nil: // Continues below. - case errors.Is(pgx.ErrNoRows, err): + case errors.Is(err, pgx.ErrNoRows): logger.Debug("no stats available yet, skipping iteration") cancel() continue