Skip to content

Commit

Permalink
Fix missing commit (#1562)
Browse files Browse the repository at this point in the history
  • Loading branch information
noboruma authored Sep 13, 2023
1 parent c942f4c commit acdecb0
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions deepfence_worker/ingesters/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,6 @@ func CommitFuncStatus[Status any](ts utils.Neo4jScanType) func(ns string, data [
func updatePodScanStatus(ts utils.Neo4jScanType,
recordMap []map[string]interface{}, session neo4j.Session) error {

tx, err := session.BeginTransaction(neo4j.WithTxTimeout(30 * time.Second))
if err != nil {
return err
}
defer tx.Close()

// TODO: Take into account all containers, not just last one
query := `
UNWIND $batch as row
Expand All @@ -101,10 +95,11 @@ func updatePodScanStatus(ts utils.Neo4jScanType,
SET n.` + ingestersUtil.ScanStatusField[ts] + `=row.scan_status`

log.Debug().Msgf("query: %v", query)
_, err = tx.Run(query,
_, err := session.Run(query,
map[string]interface{}{
"batch": recordMap,
},
neo4j.WithTxTimeout(30*time.Second),
)

if err != nil {
Expand Down

0 comments on commit acdecb0

Please sign in to comment.