Skip to content

Commit

Permalink
Merge pull request #1521 from flanksource/fix-status-check
Browse files Browse the repository at this point in the history
chore: fix last_check_status query
  • Loading branch information
moshloop authored Dec 21, 2023
2 parents 392c0d4 + dfb1189 commit 189044a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/db/canary.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func LatestCheckStatus(ctx context.Context, checkID string) (*models.CheckStatus
return nil, nil
}
var status models.CheckStatus
if err := ctx.DB().Limit(1).Select("time, created_at, status").Where("check_id = ?", checkID).Order("created_at DESC").Find(&status).Error; err != nil {
if err := ctx.DB().Limit(1).Select("time, created_at, status").Where("check_id = ?", checkID).Order("time DESC").Find(&status).Error; err != nil {
if errors.Is(err, gorm.ErrRecordNotFound) {
return nil, nil
}
Expand Down

0 comments on commit 189044a

Please sign in to comment.