fix/forzar-procesamiento-acuses
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
from celery_app import celery_app
|
||||
from celery_app import celery_app
|
||||
from .services import put_pedimento_data
|
||||
import asyncio
|
||||
import logging
|
||||
from fastapi import HTTPException as _HTTPException
|
||||
from ..tasks.services import register_task, update_task
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
@@ -84,8 +85,10 @@ def process_pedimento_completo_request(self, pedimento_data: dict):
|
||||
)
|
||||
except Exception as update_error:
|
||||
logger.error(f"Error actualizando estado de tarea: {update_error}")
|
||||
|
||||
|
||||
# Re-lanzar la excepción para que Celery la marque como fallida
|
||||
if isinstance(e, _HTTPException):
|
||||
raise RuntimeError(f"HTTP {e.status_code}: {e.detail}") from None
|
||||
raise
|
||||
finally:
|
||||
loop.close()
|
||||
Reference in New Issue
Block a user