Add improvements
This commit is contained in:
@@ -583,17 +583,24 @@ class OrchestrationSaga:
|
||||
"""
|
||||
Generate forecasts for tenant.
|
||||
|
||||
NOTE: AI insights generated in step 0.5 are already posted to the AI Insights Service
|
||||
and will be automatically consumed by the forecast service via its dynamic rules engine.
|
||||
The forecast service queries the AI Insights Service for recent insights when generating
|
||||
forecasts, so there's no need to explicitly pass them here.
|
||||
|
||||
Args:
|
||||
tenant_id: Tenant ID
|
||||
context: Execution context
|
||||
context: Execution context (includes ai_insights_posted count from step 0.5)
|
||||
|
||||
Returns:
|
||||
Forecast result
|
||||
"""
|
||||
logger.info(f"Generating forecasts for tenant {tenant_id}")
|
||||
ai_insights_count = context.get('ai_insights_posted', 0)
|
||||
logger.info(f"Generating forecasts for tenant {tenant_id} (AI insights available: {ai_insights_count})")
|
||||
|
||||
try:
|
||||
# Call forecast service with circuit breaker protection
|
||||
# The forecast service will automatically query AI Insights Service for recent insights
|
||||
if self.forecast_breaker:
|
||||
result = await self.forecast_breaker.call(
|
||||
self.forecast_client.generate_forecasts, tenant_id
|
||||
|
||||
Reference in New Issue
Block a user