Step 6: Configure Queue Workers
AI grading and other background tasks run via Laravel queues. Configure Supervisor to keep the queue worker running:
Create a Supervisor config file:
nano /etc/supervisor/conf.d/ai-education-worker.confAdd the following content:
[program:ai-education-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /var/www/ai-education-studio/artisan queue:work database --sleep=3 --tries=3 --max-time=3600
directory=/var/www/ai-education-studio
autostart=true
autorestart=true
stopasgroup=true
killasgroup=true
user=www-data
numprocs=2
redirect_stderr=true
stdout_logfile=/var/www/ai-education-studio/storage/logs/worker.logTell Supervisor to read the new config:
supervisorctl reread
supervisorctl update
supervisorctl start ai-education-worker:*Warning: If queue workers are not running, students can submit exams but they will never be AI-graded. This is the most common cause of “my exam is stuck” issues.
Last updated on