Skip to content

Commit

Permalink
ISSUE-1794: Code review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
varunsharma0286 committed Oct 3, 2023
1 parent 6077b2f commit d57d228
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions deepfence_worker/cronjobs/neo4j.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,8 @@ func CleanUpDB(ctx context.Context, task *asynq.Task) error {
if _, err = session.Run(`
MATCH (n:ContainerImage)
WHERE n.active = false
AND ((NOT exists((n) <-[:SCANNED]-()) AND
n.updated_at < TIMESTAMP() - $delete_threshold_ms)
AND ((NOT exists((n) <-[:SCANNED]-())
AND n.updated_at < TIMESTAMP() - $delete_threshold_ms)
OR n.updated_at < TIMESTAMP()-$old_time_ms)
WITH n LIMIT 10000
DETACH DELETE n`,
Expand All @@ -233,8 +233,8 @@ func CleanUpDB(ctx context.Context, task *asynq.Task) error {
if _, err = session.Run(`
MATCH (n:Container)
WHERE n.active = false
AND ((NOT exists((n) <-[:SCANNED]-()) AND
n.updated_at < TIMESTAMP() - $delete_threshold_ms)
AND ((NOT exists((n) <-[:SCANNED]-())
AND n.updated_at < TIMESTAMP() - $delete_threshold_ms)
OR n.updated_at < TIMESTAMP()-$old_time_ms)
WITH n LIMIT 10000
DETACH DELETE n`,
Expand Down

0 comments on commit d57d228

Please sign in to comment.