; /etc/supervisor/conf.d/seo-platform.conf
; Three worker groups so expensive work can never delay uptime checks and alerts.
; After editing: sudo supervisorctl reread && sudo supervisorctl update

; 1) High priority: uptime checks + e-mail alerts. Short jobs, short timeout.
[program:seo-fast]
process_name=%(program_name)s_%(process_num)02d
command=/usr/bin/php /var/www/seo-platform/current/artisan queue:work redis --queue=uptime,default --sleep=1 --tries=3 --timeout=60 --max-time=3600 --memory=256
directory=/var/www/seo-platform/current
user=deploy
numprocs=2
autostart=true
autorestart=true
stopwaitsecs=70
redirect_stderr=true
stdout_logfile=/var/www/seo-platform/shared/storage/logs/worker-fast.log
stdout_logfile_maxbytes=20MB
stdout_logfile_backups=5

; 2) Crawls + audits. numprocs should be >= Settings > "Max crawls running at the same time".
[program:seo-crawl]
process_name=%(program_name)s_%(process_num)02d
command=/usr/bin/php /var/www/seo-platform/current/artisan queue:work redis-long --queue=crawl,audit --sleep=3 --timeout=1200 --max-time=3600 --memory=512
directory=/var/www/seo-platform/current
user=deploy
numprocs=3
autostart=true
autorestart=true
stopwaitsecs=1210
redirect_stderr=true
stdout_logfile=/var/www/seo-platform/shared/storage/logs/worker-crawl.log
stdout_logfile_maxbytes=20MB
stdout_logfile_backups=5

; 3) Reports (PDF rendering is memory-heavy) + API syncs.
[program:seo-reports]
process_name=%(program_name)s_%(process_num)02d
command=/usr/bin/php /var/www/seo-platform/current/artisan queue:work redis-long --queue=reports,integrations --sleep=3 --timeout=900 --max-time=3600 --memory=768
directory=/var/www/seo-platform/current
user=deploy
numprocs=1
autostart=true
autorestart=true
stopwaitsecs=910
redirect_stderr=true
stdout_logfile=/var/www/seo-platform/shared/storage/logs/worker-reports.log
stdout_logfile_maxbytes=20MB
stdout_logfile_backups=5

[group:seo]
programs=seo-fast,seo-crawl,seo-reports
