Skip to content

Commit

Permalink
Merge pull request #437 from tbeadle/runstatistics
Browse files Browse the repository at this point in the history
Wrap the main_db call in a transaction.
  • Loading branch information
doomedraven authored Jun 26, 2024
2 parents 63d6992 + 977c6f8 commit ac76ac9
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 ac76ac9

Please sign in to comment.