What is the difference between queue:work --daemon and queue:listen

后端 未结 4 1940
礼貌的吻别
礼貌的吻别 2020-11-28 22:12

I\'m settin up my offline job server. I\'ve read the documentation but I still don\'t really see the differences between the two commands: artisan queue:work --daemon<

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-28 22:40

    As of Laravel 5.7 a new option --stop-when-empty has been added to the queue:work command. When using this option the current queue will be processed until it's empty, then the command will exit.

    According to the documentation:

    The --stop-when-empty option may be used to instruct the worker to process all jobs and then exit gracefully. This option can be useful when working Laravel queues within a Docker container if you wish to shutdown the container after the queue is empty:

    php artisan queue:work --stop-when-empty
    

提交回复
热议问题