Início / Optitravel / Core
Scheduler
Scheduler runner that dispatches due tasks into Queue.
Run
php includes/classes/Core/Scheduler/RunScheduler.php
Options:
--system-id=768(optional filter)
Recommended Cron
Run every minute:
* * * * * php /var/www/html/optitravel/includes/classes/Core/Scheduler/RunScheduler.php
DB Table (recommended source)
Expected columns in scheduler_crons:
idINT PKnameVARCHARcron_expressionVARCHAR (5 fields)queue_nameVARCHARjob_nameVARCHARpayload_jsonTEXT (JSON object)max_attemptsINTdelay_secondsINTtimezoneVARCHAR (ex:Europe/Lisbon)system_idVARCHAR NULLmisfire_policyENUM('skip','fire_once','catch_up') DEFAULT 'fire_once'max_runningINT DEFAULT 1timeout_secondsINT NULLlast_dispatched_atDATETIME NULLenabledTINYINT(1)
misfire_policy behavior:
skip: runs only when current minute matches cron.fire_once: if there are missed runs, enqueue only the most recent one.catch_up: enqueue all missed runs sincelast_dispatched_at(bounded by catch-up limit).
max_running behavior:
0: unlimited overlaps.>=1: max number of concurrent jobs allowed for that cron.
Optional env:
SCHEDULER_DEFAULT_TIMEOUT_SECONDS(default86400): fallback timeout when cron timeout is not defined.SCHEDULER_MAX_CATCH_UP_SLOTS(default120): cap of inspected missed minutes for catch-up.
Per-cron timeout override:
timeout_seconds> 0: timeout window for that cron.timeout_seconds<= 0 or NULL: usesSCHEDULER_DEFAULT_TIMEOUT_SECONDS.
Notes:
- This timeout controls overlap slot TTL for that cron (crash/stall safety).
- It does not kill a running process; it only releases scheduling protection after timeout.
↑ (Última atualização: 01/10/2026)