Skip to content

Commit dc30ff0

Browse files
committed
Expose the DB built age as a func
Signed-off-by: Nghia Tran <tcnghia@gmail.com>
1 parent b597eb6 commit dc30ff0

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pkg/scan/apk.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,15 @@ var trustedCPESources = []cpe.Source{
482482

483483
var regexGolangDateVersion = regexp.MustCompile(`^\d{4}-\d{2}-\d{2}$`)
484484

485+
// DatabaseBuiltAt returns the time when the vulnerability database was built.
486+
func (s *Scanner) DatabaseBuiltAt() time.Time {
487+
if s.dbStatus == nil {
488+
return time.Time{}
489+
}
490+
return s.dbStatus.Built
491+
}
492+
493+
485494
// Close closes the scanner's database connection.
486495
func (s *Scanner) Close() {
487496
if s.vulnProvider == nil {

0 commit comments

Comments
 (0)