fix: stabilize maintenance flow run/resume and procedural scrolling
This commit is contained in:
@@ -47,6 +47,16 @@ async def _fire_maintenance_schedule(schedule_id: str) -> None:
|
||||
logger.error(f"Tree {schedule.tree_id} not found for schedule {schedule_id}")
|
||||
return
|
||||
|
||||
if tree.tree_type != "maintenance":
|
||||
logger.warning(f"Skipping schedule {schedule_id}: tree {tree.id} is not a maintenance flow")
|
||||
return
|
||||
|
||||
if not tree.is_active or tree.status == "draft":
|
||||
logger.warning(
|
||||
f"Skipping schedule {schedule_id}: tree {tree.id} is inactive or draft"
|
||||
)
|
||||
return
|
||||
|
||||
# Resolve targets
|
||||
targets: list[dict] = []
|
||||
if schedule.target_list_id:
|
||||
@@ -61,7 +71,12 @@ async def _fire_maintenance_schedule(schedule_id: str) -> None:
|
||||
targets = [{"label": "Unassigned"}]
|
||||
|
||||
batch_id = uuid.uuid4()
|
||||
tree_snapshot = tree.tree_structure
|
||||
tree_snapshot = {
|
||||
**tree.tree_structure,
|
||||
"name": tree.name,
|
||||
"description": tree.description,
|
||||
"tree_type": tree.tree_type,
|
||||
}
|
||||
|
||||
sessions_to_add = []
|
||||
for target in targets:
|
||||
|
||||
Reference in New Issue
Block a user