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:
@@ -178,26 +178,30 @@ class Orchestrator:
|
|||||||
schedule_insertion_report = await schedule_insertion_report_handler
|
schedule_insertion_report = await schedule_insertion_report_handler
|
||||||
schedule_update_report = await schedule_update_report_handler
|
schedule_update_report = await schedule_update_report_handler
|
||||||
|
|
||||||
schedule_report_handler = workflow.start_activity_method(
|
if schedule_insertion_report or schedule_update_report or schedule_deletion_report:
|
||||||
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)
|
|
||||||
)
|
|
||||||
|
|
||||||
slot_report_handler = workflow.start_activity_method(
|
schedule_report_handler = workflow.start_activity_method(
|
||||||
Activities.report_slot_orchestration,
|
Activities.report_schedule_orchestration,
|
||||||
{
|
{
|
||||||
'inserted_slots': slot_insertion_report,
|
'created_schedules': schedule_insertion_report,
|
||||||
'deleted_slots': slot_deletion_report
|
'updated_schedules': schedule_update_report,
|
||||||
},
|
'deleted_schedules': schedule_deletion_report
|
||||||
retry_policy=retry_policy,
|
},
|
||||||
start_to_close_timeout=timedelta(seconds=60)
|
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:
|
if schedule_update_report:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user