jiordiviera/laravel-smart-scheduler
A Laravel package for smarter task scheduling: manage scheduled jobs with dynamic frequencies, overlap prevention, condition-based runs, and clear logging. Simplify cron management and keep recurring tasks predictable, organized, and easy to monitor.
Architecture fit
The package remains a Laravel-native scheduler wrapper: it hooks into the framework's task lifecycle, persists run state in an Eloquent model (ScheduleRun), and emits notifications through a contracted interface (SmartNotifierInterface). v1.1.0 deepens this fit rather than changing it — stuck detection is layered onto the existing SmartSchedulerManager pre-flight path, and the new isStuck() helper exposes state through the model rather than a new subsystem. For a TPM, this is the desirable shape: new capability arrives as state + artisan command + config toggle, all of which map onto conventions the team already operates.
The one architectural signal worth flagging is that the manager now performs a write (marking tasks STATUS_STUCK) before its overlap read. That is a behavioural change in the scheduling hot path, not just an additive feature.
Integration feasibility
Low-to-moderate effort. Additive surface is straightforward: two config keys (stuck_timeout_minutes, notify_on_stuck), one artisan command, one model helper, one mail template. No database migration is mentioned, but STATUS_STUCK implies an existing status column must accept the new value — confirm whether that column is an enum, a DB-level enum, or a plain string, as a constrained enum would require a migration the notes do not call out.
The genuine integration risk is the modified SmartNotifierInterface contract. Adding sendStuckNotification() to an interface is a breaking change for every in-house or third-party implementer, despite shipping under a minor version. Any team with a custom notifier (Slack, Teams, PagerDuty) will get a fatal error on upgrade until the method is implemented.
Technical risk
notify_on_stuck; a systemic failure (queue down, DB degraded) could fan out into a mail storm.Key questions
sendStuckNotification() a required interface method or is a default/trait provided? Determines whether the upgrade is blocking.STATUS_STUCK require a schema change, and is the status column string or enum?stuck_timeout_minutes per-task overridable, or global only?--dry-run suppress state mutation as well as notifications?Stack fit
Requires Laravel with the standard scheduler and mail stack already in use. No new infrastructure dependencies. The artisan command fits existing ops runbooks (cron/supervisor-driven), so no new operational surface for platform teams.
Migration path
SmartNotifierInterface implementations before touching the package. This is the gating step; everything else is additive.sendStuckNotification() in every custom notifier — start with a no-op or log-only body to unblock the upgrade, then wire real channels.notify_on_stuck to false initially. Ship the detection capability without the notification blast radius, observe classification accuracy for one to two weeks, then enable.stuck_timeout_minutes against actual p95/p99 runtimes before enabling notifications.Compatibility
Upgrade is blocking for custom notifier implementers and non-blocking for consumers using the bundled notifier. Downstream compatibility risk sits in reporting: any dashboard, alert rule, or reconciliation query enumerating statuses needs STATUS_STUCK added or it will under-report.
Sequencing
Contract audit → schema check → notifier implementations → upgrade → detection enabled with notifications off → timeout calibration → notifications enabled → dashboards/alerts updated. Do not compress the calibration window; the default timeout is unlikely to match production runtimes.
Maintenance
Ongoing cost is modest: one config value to tune, one command to schedule (or rely on the automatic in-path detection). The maintenance burden that matters is classification accuracy — an untuned timeout generates recurring false positives that erode trust in the alert channel, which is the classic failure mode for this class of feature.
Support
Support load will concentrate in two areas: (a) upgrade failures from the contract change, resolvable once with a documented implementer checklist; (b) "why was my task marked stuck" tickets, best pre-empted by documenting the timeout semantics and the auto-detection trigger in the internal runbook.
Scaling
Detection cost is a per-execution write plus a scan on the detect-stuck command. At high task volumes, the command should be run on a schedule with a bounded lookback window rather than as a full-table scan; validate query performance against the ScheduleRun table size before enabling in production. Notification fan-out is the more likely scaling limit — enforce a rate limit or digest before broad enablement.
Failure modes
STATUS_STUCK in dashboards.Ramp-up
Roughly half a day of engineering for the contract audit and notifier updates, plus a one-to-two week observation window with notifications disabled before enabling. The TPM decision worth making explicitly: treat v1.1.0 as a breaking change internally, despite its version number, and gate the rollout on the notifier audit completing rather than on the version bump appearing benign.
How can I help you explore Laravel packages today?