mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-09-11 22:12:23 +00:00
eed80e2883
The "Every" dropdown on the Patrol page was not being respected. Setting 15 min would show "Runs every 6 hours" and the countdown timer was wrong. Root cause: PatrolSchedulePreset and PatrolIntervalMinutes had omitempty JSON tags. When the API handler cleared the preset to "", json.Marshal dropped the field. On reload, NewDefaultAIConfig() re-introduced "6hr" as the preset, which took priority over the user's custom minutes. Additional fixes in the same area: - Track nextScheduledAt explicitly in the patrol loop so next_patrol_at reflects the actual ticker schedule, not a stale lastPatrol + interval calculation that diverges when the interval changes mid-cycle. - Refetch patrol status in the frontend after an interval change so the countdown timer updates immediately. - Seed lastPatrol from persisted run history on startup so the header countdown timer appears immediately after a backend restart.