fix(ogcore): fix scheduled task execution and UTC timezone handling #106

Merged
maranda merged 1 commits from fix_scheduled_tasks into main 2026-05-06 17:26:58 +02:00

1 Commits (main)

Author SHA1 Message Date
Nicolas Arenas a8cdae154b fix(ogcore): fix scheduled task execution and UTC timezone handling
testing/ogcore-api/pipeline/head There was a failure building this commit Details
testing/ogcore-api/pipeline/pr-main There was a failure building this commit Details
- Fix executeReboot response check: use getStatusCode() instead of
  json_decode(body)['status'], which never matched the Client entity body
- Fix executeRunScript: same check fix; remove duplicate trace status
  update since RunScriptAction already handles it via updateExistingTrace
- Normalize executionDate/executionTime to UTC at API boundary in
  CommandTaskScheduleInput to prevent client/server timezone drift
- Use UTC consistently in calculateNextExecutionDate and
  RunScheduledCommandTasksCommand for all datetime comparisons
- Replace 30-second execution window (abs(difference) < 30) with
  isDue && notYetExecuted logic so tasks missed by the cron are
  recovered in the next cycle instead of being skipped forever
- Skip one-time (none) tasks with a past executionDate in
  calculateNextExecutionDate so nextExecution is set to null after
  execution and the task no longer appears in cron logs
2026-05-06 15:30:37 +02:00