Skip to content

Commit

Permalink
Merge pull request Ericsson#3339 from csordasmarton/fix_analysis_info…
Browse files Browse the repository at this point in the history
…_storage

[server] Fix getting existing analysis info
  • Loading branch information
bruntib authored Jun 1, 2021
2 parents f6e3f5a + ec2469c commit 8880695
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions web/server/codechecker_server/api/mass_store_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -656,12 +656,18 @@ def __store_analysis_info(
analyzer_command.encode("utf-8"),
zlib.Z_BEST_COMPRESSION)

analysis_info = session \
analysis_info_rows = session \
.query(AnalysisInfo) \
.filter(AnalysisInfo.analyzer_command == cmd) \
.one_or_none()

if not analysis_info:
.all()

if analysis_info_rows:
# It is possible when multiple runs are stored
# simultaneously to the server with the same analysis
# command that multiple entries are stored into the
# database. In this case we will select the first one.
analysis_info = analysis_info_rows[0]
else:
analysis_info = AnalysisInfo(analyzer_command=cmd)
session.add(analysis_info)

Expand Down

0 comments on commit 8880695

Please sign in to comment.