From 8b52bdff77086b95f8c056d329dac13a5db3a969 Mon Sep 17 00:00:00 2001 From: Yash Mehrotra Date: Wed, 3 Jan 2024 21:13:50 +0530 Subject: [PATCH] fix: transformed checks returning correct id --- pkg/cache/postgres.go | 2 +- pkg/jobs/canary/canary_jobs.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/cache/postgres.go b/pkg/cache/postgres.go index f2c9966da..06ff1c51e 100644 --- a/pkg/cache/postgres.go +++ b/pkg/cache/postgres.go @@ -58,7 +58,7 @@ func (c *postgresCache) AddCheckFromStatus(check pkg.Check, status pkg.CheckStat } if check.ID != uuid.Nil { - return uuid.Nil, nil + return check.ID, nil } return db.PersistCheck(c.DB(), check, check.CanaryID) diff --git a/pkg/jobs/canary/canary_jobs.go b/pkg/jobs/canary/canary_jobs.go index c8a384846..c1aa540c3 100644 --- a/pkg/jobs/canary/canary_jobs.go +++ b/pkg/jobs/canary/canary_jobs.go @@ -173,6 +173,7 @@ func (j CanaryJob) Run(ctx dutyjob.JobRuntime) error { // Update last runtime map canaryLastRuntimes.Store(canaryID, time.Now()) + ctx.History.SuccessCount = len(results) return nil }