diff --git a/cmd/libvulnhttp/main.go b/cmd/libvulnhttp/main.go index 20b2f18dc..e87d8b06c 100644 --- a/cmd/libvulnhttp/main.go +++ b/cmd/libvulnhttp/main.go @@ -6,6 +6,7 @@ import ( "net/http" "os" "strings" + "time" "github.com/crgimenes/goconfig" "github.com/quay/zlog" @@ -81,6 +82,9 @@ func confToLibvulnOpts(conf Config) *libvuln.Opts { Migrations: true, UpdaterSets: nil, DisableBackgroundUpdates: conf.DisableBackgroundUpdates, + UpdateInterval: 30 * time.Second, + UpdateWorkers: 10, + UpdateRetention: 10, } return opts diff --git a/internal/vulnstore/postgres/store.go b/internal/vulnstore/postgres/store.go index 9ede73319..9dd3ba340 100644 --- a/internal/vulnstore/postgres/store.go +++ b/internal/vulnstore/postgres/store.go @@ -105,7 +105,7 @@ WHERE array_length(ordered_ops.refs, 1) > $2; ` deleteVulns = ` -DELETE FROM vuln WHERE id NOT IN (SELECT vuln FROM uo_vuln); +DELETE FROM vuln WHERE NOT EXISTS (SELECT * FROM uo_vuln WHERE vuln.id = uo_vuln.vuln); ` )