ramadanproject/docs/SCHEDULER.md
Ahmed Darrazi 45a147253c
Some checks failed
tests / ci (push) Failing after 6m13s
linter / quality (pull_request) Failing after 58s
linter / quality (push) Failing after 1m19s
tests / ci (pull_request) Failing after 5m28s
feat(public-grid): add QA, quickstart, decision docs; scheduler docs; ignore files; tasks updates; run pint
2026-01-03 04:56:12 +01:00

25 lines
1.0 KiB
Markdown

Scheduler: running `reservations:expire`
We added `reservations:expire` as an Artisan command and scheduled it to run every minute via `App\Providers\SchedulerServiceProvider`.
How to run the scheduler
- Recommended (development with Sail): run the long-running scheduler worker inside Sail:
```bash
./vendor/bin/sail artisan schedule:work
```
This will run scheduled tasks in the foreground. To run in background with Sail, open a separate terminal and start it with `--detach` or use your terminal multiplexer.
- Alternative (host cron): add an entry to crontab on the host that triggers Laravel's scheduler every minute:
```cron
* * * * * cd /path/to/project && ./vendor/bin/sail artisan schedule:run >> /dev/null 2>&1
```
Notes
- On production, prefer running `schedule:run` from a system cron or a host scheduler. If you run inside Docker, use a dedicated scheduler container or the `schedule:work` command.
- The scheduled task will call the `reservations:expire` command which marks held reservations as `expired` when their `reserved_until` is in the past.