1
0
Fork 0
mirror of https://github.com/gocsaf/csaf.git synced 2025-12-22 11:55:40 +01:00

Add time interval filtering to downloader.

This commit is contained in:
Sascha L. Teichmann 2023-07-26 03:22:33 +02:00
parent 0e297fc616
commit de0599ebe3
4 changed files with 36 additions and 12 deletions

View file

@ -153,6 +153,11 @@ func (d *downloader) download(ctx context.Context, domain string) error {
base,
nil)
// Do we need time range based filtering?
if d.cfg.Range != nil {
afp.AgeAccept = d.cfg.Range.Contains
}
return afp.Process(func(label csaf.TLPLabel, files []csaf.AdvisoryFile) error {
return d.downloadFiles(ctx, label, files)
})