Appearance
Cron & queue
Production setup has two separate concerns:
| Concern | Required when | Doc section |
|---|---|---|
| Cron | Automatic currency rate sync is enabled in admin | Scheduler |
| Queue worker | QUEUE_CONNECTION=database and you use queued mail/jobs | Queue workers |
If you use neither automatic rates nor queued jobs, you can use QUEUE_CONNECTION=sync and skip the worker entirely.
Laravel scheduler (required for rate sync)
ExchangePro registers an hourly task in routes/console.php to sync currency prices when the feature is enabled in admin.
Cron entry
Add one line to the server crontab (crontab -e as the web user or root):
text
* * * * * cd /var/www/exchangepro/backend && php artisan schedule:run >> /dev/null 2>&1Replace the path with your backend directory.
Verify scheduler
bash
php artisan schedule:listYou should see the hourly CurrencyRateSyncService callback.
Test manually
bash
php artisan schedule:runCheck admin currency prices or logs for sync activity.
Queue workers (optional)
Default .env:
ini
QUEUE_CONNECTION=databaseLaravel creates a jobs table via migrations. For queued mail or heavy tasks, run a worker:
bash
php artisan queue:work --tries=3Supervisor example
/etc/supervisor/conf.d/exchangepro-worker.conf:
ini
[program:exchangepro-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /var/www/exchangepro/backend/artisan queue:work --sleep=3 --tries=3 --max-time=3600
autostart=true
autorestart=true
user=www-data
numprocs=1
redirect_stderr=true
stdout_logfile=/var/www/exchangepro/backend/storage/logs/worker.logbash
sudo supervisorctl reread
sudo supervisorctl update
sudo supervisorctl start exchangepro-worker:*If you do not run a queue worker, keep QUEUE_CONNECTION=sync for immediate processing (simpler, fine for low traffic).
What does NOT require cron
| Feature | Mechanism |
|---|---|
| User sessions | Database / cookie lifetime |
| Exchange approval | Admin manual action |
| Public rates display | Read from DB on request |
Logs
| Log | Path |
|---|---|
| Laravel | backend/storage/logs/laravel.log |
| Queue worker | Supervisor log path above |
| Nuxt / PM2 | PM2 or systemd journal |
Monitor disk space on storage/logs in production.