On a standard cPanel shared hosting environment there is no persistent process manager, so both the Laravel scheduler and the queue worker must be registered as separate cron jobs. The scheduler triggers timed tasks every minute; the queue worker processes jobs from theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/scooller/Leben-site/llms.txt
Use this file to discover all available pages before exploring further.
jobs table. Running schedule:run alone will not consume queued jobs when QUEUE_CONNECTION=database.
Required Cron Jobs
Add the two entries below in cPanel → Cron Jobs. Both run every minute (* * * * *). Adjust /home/adminmktleben/laravel to match your account’s actual home directory.
1 — Laravel Scheduler
Fires all scheduled tasks defined in the application’s console kernel.2 — Queue Worker (with flock)
Processes jobs from thedatabase queue. flock prevents multiple overlapping worker instances from starting between cron cycles.
| Flag | Value | Purpose |
|---|---|---|
--queue | default | Processes the default queue |
--sleep | 3 | Seconds to sleep when no jobs are waiting |
--tries | 3 | Max attempts before a job is marked failed |
--backoff | 5 | Seconds to wait between retry attempts |
--max-time | 50 | Worker exits after 50 s (safely before next cron cycle) |
--stop-when-empty | — | Exits cleanly when the queue is drained |
Verify the path to
flock on your server before saving the cron job. Run which flock in an SSH session — the path is usually /usr/bin/flock but may differ across hosts.Scheduled Tasks
These are the recurring tasks registered in iLeben’s scheduler. They run automatically once the scheduler cron job is active.| Command / Job | Frequency | Purpose |
|---|---|---|
reservations:expire | Every minute | Expires overdue plant reservations |
SyncPlantsJob (job) | Every minute (runs every 5 min by default, configurable via salesforce_sync_interval_minutes setting) | Syncs plant catalogue from Salesforce |
model:prune (FrontendPreviewLink) | Daily | Prunes expired frontend preview link records |
salesforce:refresh-token | Every 20 hours (0 */20 * * *) | Refreshes OAuth token and syncs backup |
Queue Configuration
iLeben uses thedatabase queue driver on cPanel. Ensure your .env contains:
jobs table. Completed jobs are removed automatically; failed jobs move to the failed_jobs table after exhausting all retry attempts.
Log Rotation
The queue worker appends all output tostorage/logs/queue-worker.log. Without rotation this file will grow unboundedly. Add these two cron jobs to rotate daily and keep 14 days of history.
Rotate at midnight (00:00):
In cPanel’s cron editor the
% character must be escaped as \%. The commands above are already escaped — do not add additional escaping.Troubleshooting
Jobs accumulate with attempts = 0
If you query the jobs table and see rows with attempts = 0 and reserved_at = NULL that are not being processed, the queue worker cron job is not running. Verify:
- The worker cron entry exists in cPanel → Cron Jobs.
- The
flockpath (/usr/bin/flock) is correct for your server. - The artisan path (
/home/adminmktleben/laravel/artisan) matches your install location. - Check
storage/logs/queue-worker.logfor PHP errors or permission issues.
Verifying the worker is processing
Monitor thejobs table row count and watch the log file in real time:
jobs should decrease after each cron cycle when the worker is operating correctly.