From 80861997afd2390f79cdd7094a5fac8b9420f4ae Mon Sep 17 00:00:00 2001 From: serversdwn Date: Wed, 18 Feb 2026 06:44:04 +0000 Subject: [PATCH] Fix: removed duplicate download following scheduled stop. --- .../services/recurring_schedule_service.py | 25 +++---------------- backend/services/slmm_client.py | 2 +- 2 files changed, 4 insertions(+), 23 deletions(-) diff --git a/backend/services/recurring_schedule_service.py b/backend/services/recurring_schedule_service.py index d19ce41..bce6f7b 100644 --- a/backend/services/recurring_schedule_service.py +++ b/backend/services/recurring_schedule_service.py @@ -332,10 +332,12 @@ class RecurringScheduleService: ) actions.append(start_action) - # Create STOP action + # Create STOP action (stop_cycle handles download when include_download is True) stop_notes = json.dumps({ "schedule_name": schedule.name, "schedule_id": schedule.id, + "schedule_type": "weekly_calendar", + "include_download": schedule.include_download, }) stop_action = ScheduledAction( id=str(uuid.uuid4()), @@ -350,27 +352,6 @@ class RecurringScheduleService: ) actions.append(stop_action) - # Create DOWNLOAD action if enabled (1 minute after stop) - if schedule.include_download: - download_time = end_utc + timedelta(minutes=1) - download_notes = json.dumps({ - "schedule_name": schedule.name, - "schedule_id": schedule.id, - "schedule_type": "weekly_calendar", - }) - download_action = ScheduledAction( - id=str(uuid.uuid4()), - project_id=schedule.project_id, - location_id=schedule.location_id, - unit_id=unit_id, - action_type="download", - device_type=schedule.device_type, - scheduled_time=download_time, - execution_status="pending", - notes=download_notes, - ) - actions.append(download_action) - return actions def _generate_interval_actions( diff --git a/backend/services/slmm_client.py b/backend/services/slmm_client.py index b6b683e..b1dcae1 100644 --- a/backend/services/slmm_client.py +++ b/backend/services/slmm_client.py @@ -659,7 +659,7 @@ class SLMMClient: # Format as Auto_XXXX folder name folder_name = f"Auto_{index_number:04d}" - remote_path = f"/NL43_DATA/{folder_name}" + remote_path = f"/NL-43/{folder_name}" # Download the folder result = await self.download_folder(unit_id, remote_path)