mirror of
https://github.com/project-zot/zot.git
synced 2025-02-17 23:45:36 -05:00
fix(cve): fix trivyDB being downloaded multiple times in a loop (#1255)
The condition to generate trivyDB download tasks was bugged, and new tasks were generated in case the download had already been successful (state `done`). Signed-off-by: Andrei Aaron <aaaron@luxoft.com>
This commit is contained in:
parent
f04e66a5e2
commit
c731acf6de
1 changed files with 1 additions and 1 deletions
|
@ -91,7 +91,7 @@ func (gen *trivyTaskGenerator) GenerateTask() (scheduler.Task, error) {
|
|||
|
||||
gen.lock.Lock()
|
||||
|
||||
if gen.status != running && time.Since(gen.lastTaskTime) >= gen.waitTime {
|
||||
if gen.status == pending && time.Since(gen.lastTaskTime) >= gen.waitTime {
|
||||
newTask = newTrivyTask(gen.interval, gen.cveInfo, gen, gen.log)
|
||||
gen.status = running
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue