設定ファイルを追加した際には読み込まないとエラーになる
新しく設定ファイルを更新した
/etc/supervisor/conf.d/laravel-worker.conf
[program:laravel-worker-staging] process_name=%(program_name)s_%(process_num)02d command=php /var/www/dev-project/artisan queue:work main-sqs --timeout=600 --sleep=3 --tries=1 autostart=true autorestart=true user=www-data numprocs=4 redirect_stderr=true stdout_logfile=/var/www/dev-project/storage/logs/job-worker.log [program:laravel-verify-email-address-worker-staging] process_name=%(program_name)s_%(process_num)02d command=/usr/bin/php7.2 /var/www/dev-project/artisan queue:listen verify-email-address --timeout=700 --sleep=3 --tries=1 autostart=true autorestart=true user=www-data numprocs=4 redirect_stderr=true stdout_logfile=/var/www/dev-project/storage/logs/job-worker.log [program:laravel-delete-email-address-worker-staging] process_name=%(program_name)s_%(process_num)02d command=/usr/bin/php7.2 /var/www/dev-project/artisan queue:listen delete-email-address --timeout=700 --sleep=3 --tries=1 autostart=true autorestart=true user=www-data numprocs=4 redirect_stderr=true stdout_logfile=/var/www/dev-project/storage/logs/job-worker.log
config/queue.php
$verify_email_addrerss_queue = env('APP_ENV', 'local') . '-verify-client-email-queue'; $delete_email_addrerss_queue = env('APP_ENV', 'local') . '-delete-client-email-queue'; return [ 'verify-email-address' => [ 'driver' => 'sqs', 'key' => env('SQS_KEY', 'your-public-key'), 'secret' => env('SQS_SECRET', 'your-secret-key'), 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'), 'queue' => $verify_email_addrerss_queue, 'region' => env('SQS_REGION', 'us-east-1'), 'version' => '2012-11-05', 'retry_after' => 710, ], 'delete-email-address' => [ 'driver' => 'sqs', 'key' => env('SQS_KEY', 'your-public-key'), 'secret' => env('SQS_SECRET', 'your-secret-key'), 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'), 'queue' => $delete_email_addrerss_queue, 'region' => env('SQS_REGION', 'us-east-1'), 'version' => '2012-11-05', 'retry_after' => 710, ],
もくじ
パラメータについて
- –tries=1
失敗時のリトライ回数
historyが荒れるので1回で良い。 - コンフィグのretry_afterの値
–timeout=600より長くすること
これを読み込ませたい🐱
読み込み
supervisorctl reread supervisorctl update supervisorctl reload
全体再起動
sudo supervisorctl stop all sudo supervisorctl reread sudo supervisorctl update sudo supervisorctl start all sudo supervisorctl status