SIENTIAPDE-1150

refactor: update orchestration workflow to conditionally start schedule and slot report handlers based on report availability, improving clarity and efficiency
This commit is contained in:
vitor-aignosi
2025-07-15 09:02:46 -03:00
parent 011b97607a
commit bc0b47fe36

View File

@@ -178,26 +178,30 @@ class Orchestrator:
schedule_insertion_report = await schedule_insertion_report_handler
schedule_update_report = await schedule_update_report_handler
schedule_report_handler = workflow.start_activity_method(
Activities.report_schedule_orchestration,
{
'created_schedules': schedule_insertion_report,
'updated_schedules': schedule_update_report,
'deleted_schedules': schedule_deletion_report
},
retry_policy=retry_policy,
start_to_close_timeout=timedelta(seconds=60)
)
if schedule_insertion_report or schedule_update_report or schedule_deletion_report:
slot_report_handler = workflow.start_activity_method(
Activities.report_slot_orchestration,
{
'inserted_slots': slot_insertion_report,
'deleted_slots': slot_deletion_report
},
retry_policy=retry_policy,
start_to_close_timeout=timedelta(seconds=60)
)
schedule_report_handler = workflow.start_activity_method(
Activities.report_schedule_orchestration,
{
'created_schedules': schedule_insertion_report,
'updated_schedules': schedule_update_report,
'deleted_schedules': schedule_deletion_report
},
retry_policy=retry_policy,
start_to_close_timeout=timedelta(seconds=60)
)
if slot_insertion_report or slot_deletion_report:
slot_report_handler = workflow.start_activity_method(
Activities.report_slot_orchestration,
{
'inserted_slots': slot_insertion_report,
'deleted_slots': slot_deletion_report
},
retry_policy=retry_policy,
start_to_close_timeout=timedelta(seconds=60)
)
if schedule_update_report: