无法在pm2中解析队列
unable to parse queue in pm2
我想在服务器中添加这些作业但出现错误(pm2) :
apps:
- name: laravel-queue-worker
script:php /var/www/html/backendcodes/artisan
exec_mode: fork
interpreter: php
instances: 1
args:
- queue:work
- --queue=sendSms,sendNotification,sendEmail
- --tries=3
- --sleep=3
当我运行
pm2 start laravel-queue-worker.yml
它 returns :
[PM2][ERROR] File laravel-queue-worker.yml malformated
{ [Error: Unable to parse.]
message: 'Unable to parse.',
parsedLine: 3,
snippet: 'script:php /var/www/html/raffle-backend-master/artisan' }
试试这个 .yaml,你可以使用在线 lint 检查语法,比如 this。
问题出在这里 -> script:php/var/www/html/backendcodes/artisan
您需要在 script:.
之后插入一个 space
apps:
-
args:
- "queue:work"
- "--queue=sendSms,sendNotification,sendEmail"
- "--tries=3"
- "--sleep=3"
exec_mode: fork
instances: 1
interpreter: php
name: laravel-queue-worker
script: "php /var/www/html/backendcodes/artisan"
我想在服务器中添加这些作业但出现错误(pm2) :
apps:
- name: laravel-queue-worker
script:php /var/www/html/backendcodes/artisan
exec_mode: fork
interpreter: php
instances: 1
args:
- queue:work
- --queue=sendSms,sendNotification,sendEmail
- --tries=3
- --sleep=3
当我运行
pm2 start laravel-queue-worker.yml
它 returns :
[PM2][ERROR] File laravel-queue-worker.yml malformated
{ [Error: Unable to parse.]
message: 'Unable to parse.',
parsedLine: 3,
snippet: 'script:php /var/www/html/raffle-backend-master/artisan' }
试试这个 .yaml,你可以使用在线 lint 检查语法,比如 this。
问题出在这里 -> script:php/var/www/html/backendcodes/artisan
您需要在 script:.
apps:
-
args:
- "queue:work"
- "--queue=sendSms,sendNotification,sendEmail"
- "--tries=3"
- "--sleep=3"
exec_mode: fork
instances: 1
interpreter: php
name: laravel-queue-worker
script: "php /var/www/html/backendcodes/artisan"