【问题标题】:unable to parse queue in pm2无法解析 pm2 中的队列
【发布时间】:2021-08-13 15:58:35
【问题描述】:

我想在服务器中添加这些作业但有错误(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 启动 laravel-queue-worker.yml

它返回:

 [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' }

【问题讨论】:

    标签: laravel jobs


    【解决方案1】:

    试试这个 .yaml,你可以使用 lint 在线检查语法,比如this。 问题出在这里-> script:php/var/www/html/backendcodes/artisan 您需要在脚本后插入一个空格:。

    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"
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-11-26
      • 2015-05-23
      • 1970-01-01
      • 2022-10-08
      • 2018-01-10
      相关资源
      最近更新 更多