[program:bookingapp-worker]
; ============================================================
; Supervisor configuration for BookingApp queue worker
; Place this file at: /etc/supervisor/conf.d/bookingapp-worker.conf
; Then run:  sudo supervisorctl reread && sudo supervisorctl update
; ============================================================

; Path to your Laravel project root
command=/usr/bin/php /var/www/bookingapp/artisan queue:work database --sleep=3 --tries=3 --max-time=3600 --timeout=90

; Run 2 worker processes (increase for high-traffic sites)
numprocs=2

; Run as your web server user (www-data on Ubuntu/Debian, nginx on CentOS)
user=www-data

; Auto-restart worker if it crashes
autostart=true
autorestart=true

; Give each process a unique name
process_name=%(program_name)s_%(process_num)02d

; Redirect output to log files
stdout_logfile=/var/www/bookingapp/storage/logs/worker.log
stderr_logfile=/var/www/bookingapp/storage/logs/worker-error.log
stdout_logfile_maxbytes=10MB
stderr_logfile_maxbytes=10MB

; Stop signal
stopsignal=TERM
stopwaitsecs=60
