From e81badae29775d0d9da0797d55747d7560061863 Mon Sep 17 00:00:00 2001 From: joseph-sentry <136376984+joseph-sentry@users.noreply.github.com> Date: Thu, 23 May 2024 14:25:35 -0400 Subject: [PATCH] fix: cleanup bundle report in finally (#459) --- tasks/bundle_analysis_processor.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tasks/bundle_analysis_processor.py b/tasks/bundle_analysis_processor.py index 2e2f69a76..a6cd6604c 100644 --- a/tasks/bundle_analysis_processor.py +++ b/tasks/bundle_analysis_processor.py @@ -132,9 +132,6 @@ def process_impl_within_lock( self.retry(max_retries=5, countdown=20) result.update_upload() - if result.bundle_report: - result.bundle_report.cleanup() - processing_results.append(result.as_dict()) except (CeleryError, SoftTimeLimitExceeded, SQLAlchemyError): raise @@ -153,6 +150,9 @@ def process_impl_within_lock( upload.state_id = UploadState.ERROR.db_id upload.state = "error" raise + finally: + if result.bundle_report: + result.bundle_report.cleanup() log.info( "Finished bundle analysis processor",