Skip to content

Commit

Permalink
Wrap the main_db call in a transaction.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tommy Beadle committed Jun 26, 2024
1 parent 63d6992 commit 977c6f8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions modules/reporting/runstatistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ def run(self, results):
detail["anti_issues"],
) = self.getSignaturesAndAlertCount(results)
detail["files_written"] = self.getFilesWrittenCount(results)
if main_db.add_statistics_to_task(task_id, detail):
log.debug("Run statistics sucessed!")
else:
log.debug("Run statistics failed!")
with main_db.session.begin():
if main_db.add_statistics_to_task(task_id, detail):
log.debug("Run statistics succeeded!")
else:
log.debug("Run statistics failed!")

0 comments on commit 977c6f8

Please sign in to comment.