Skip to content

Commit

Permalink
RHINENG-11929: return errata from db if it does not have attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
psegedy committed Aug 13, 2024
1 parent 4f50a2c commit 090d60e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions manager/controllers/advisory_detail.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,15 @@ func tryGetAdvisoryFromCache(advisoryName string) *AdvisoryDetailResponse {
return nil
}
middlewares.AdvisoryDetailCnt.WithLabelValues("hit").Inc()

emptyTime := time.Time{}
if val.Data.Attributes.PublicDate == emptyTime {
// advisory is found in cache but was inserted from yum_updates
// it is missing all attributes such as description, public_date, modified_date, etc.
// these attributes are added after the advisory is synced by vmaas-sync
// don't use the value from cache but from DB
return nil
}
return &val
}

Expand Down

0 comments on commit 090d60e

Please sign in to comment.