Skip to content

Commit

Permalink
Remove the temporary files
Browse files Browse the repository at this point in the history
  • Loading branch information
Szelethus committed Mar 21, 2024
1 parent 40b1c6d commit 5328ded
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions web/client/codechecker_client/cmd/store.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,7 @@ def assemble_zip(inputs,
file_paths.update(report.original_files)
file_report_positions[report.file.original_path].add(report.line)

files_to_delete = []
for dirname, analyzer_reports in unique_reports.items():
for analyzer_name, reports in analyzer_reports.items():
if not analyzer_name:
Expand All @@ -500,6 +501,7 @@ def assemble_zip(inputs,
AnalyzerInfo(analyzer_name))
LOG.debug(f"Stored '{analyzer_name}' unique reports in {tmpfile}.")
files_to_compress[dirname].add(tmpfile)
files_to_delete.append(tmpfile)

if changed_files:
reports_helper.dump_changed_files(changed_files)
Expand Down Expand Up @@ -640,6 +642,10 @@ def assemble_zip(inputs,
LOG.info("Compressing report zip file done (%s / %s).",
sizeof_fmt(zip_size), sizeof_fmt(compressed_zip_size))

# We are responsible for deleting these.
for file in files_to_delete:
os.remove(file)


def should_be_zipped(input_file: str, input_files: Iterable[str]) -> bool:
"""
Expand Down

0 comments on commit 5328ded

Please sign in to comment.