Skip to content

Commit e1f06b1

Browse files
authored
Merge pull request #1765 from tcnghia/expose-scanner-age
Expose the DB built age as a func
2 parents b597eb6 + 8f261f9 commit e1f06b1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pkg/scan/apk.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,14 @@ 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+
485493
// Close closes the scanner's database connection.
486494
func (s *Scanner) Close() {
487495
if s.vulnProvider == nil {

0 commit comments

Comments
 (0)