diff --git a/src/backend/app/projects/image_processing.py b/src/backend/app/projects/image_processing.py index 8984d0af6..4239d422f 100644 --- a/src/backend/app/projects/image_processing.py +++ b/src/backend/app/projects/image_processing.py @@ -520,6 +520,18 @@ async def process_assets_from_odm( log.error(f"Error during processing for project {dtm_project_id}: {e}") finally: + if task: + try: + log.info(f"Attempting to delete task {odm_task_id} from NodeODM.") + task.remove() + log.info( + f"Successful attempt at deleting task {odm_task_id} from NodeODM." + ) + except Exception as e: + log.error( + f"Error occurred while cleaning up task {odm_task_id} from NodeODM: {e}." + ) + if os.path.exists(output_file_path): try: shutil.rmtree(output_file_path)