|
|
|
|
@ -112,7 +112,7 @@ def run_heatmap_task(task_id, original_image_path, perturbed_image_path,
|
|
|
|
|
completed_status = TaskStatus.query.filter_by(task_status_code='completed').first()
|
|
|
|
|
if completed_status:
|
|
|
|
|
task.tasks_status_id = completed_status.task_status_id
|
|
|
|
|
task.completed_at = datetime.utcnow()
|
|
|
|
|
task.finished_at = datetime.utcnow()
|
|
|
|
|
db.session.commit()
|
|
|
|
|
|
|
|
|
|
logger.info(f"Heatmap task {task_id} completed")
|
|
|
|
|
@ -125,7 +125,7 @@ def run_heatmap_task(task_id, original_image_path, perturbed_image_path,
|
|
|
|
|
failed_status = TaskStatus.query.filter_by(task_status_code='failed').first()
|
|
|
|
|
if failed_status:
|
|
|
|
|
task.tasks_status_id = failed_status.task_status_id
|
|
|
|
|
task.completed_at = datetime.utcnow()
|
|
|
|
|
task.finished_at = datetime.utcnow()
|
|
|
|
|
db.session.commit()
|
|
|
|
|
|
|
|
|
|
return {'success': False, 'error': str(e)}
|
|
|
|
|
|