Fix new services implementation 5

This commit is contained in:
Urtzi Alfaro
2025-08-15 17:53:59 +02:00
parent 03b4d4185d
commit f7de9115d1
43 changed files with 1714 additions and 891 deletions

View File

@@ -186,6 +186,15 @@ async def execute_enhanced_training_job_background(
enhanced_training_service = EnhancedTrainingService(database_manager)
try:
# Create initial training log entry first
await enhanced_training_service._update_job_status_repository(
job_id=job_id,
status="pending",
progress=0,
current_step="Starting enhanced training job",
tenant_id=tenant_id
)
# Publish job started event
await publish_job_started(job_id, tenant_id, {
"enhanced_features": True,
@@ -214,7 +223,8 @@ async def execute_enhanced_training_job_background(
job_id=job_id,
status="running",
progress=0,
current_step="Initializing enhanced training pipeline"
current_step="Initializing enhanced training pipeline",
tenant_id=tenant_id
)
# Execute the enhanced training pipeline with repository pattern
@@ -232,7 +242,8 @@ async def execute_enhanced_training_job_background(
status="completed",
progress=100,
current_step="Enhanced training completed successfully",
results=result
results=result,
tenant_id=tenant_id
)
# Publish enhanced completion event
@@ -262,7 +273,8 @@ async def execute_enhanced_training_job_background(
status="failed",
progress=0,
current_step="Enhanced training failed",
error_message=str(training_error)
error_message=str(training_error),
tenant_id=tenant_id
)
except Exception as status_error:
logger.error("Failed to update job status after training error",