讨论数量:
启动队列:
queue:work
有个参数 --stop-when-empty
可以让队列运行完成后退出。
运行中的队列
queue:restart
命令会等待队列中的 任务完成后 重启队列(优雅重启)。
此命令同样作用于 Supervisor 运行的 queue:work --daemon
,不过需要在 supervisor 的配置中加入 autorestart=true
进行设置。详见 队列 worker & 部署
优雅停止队列
目前 Laravel 8 未提供关闭队列的命令:
$ art | grep queue
horizon:clear Delete all of the jobs from the specified queue
horizon:forget Delete a failed queue job
horizon:snapshot Store a snapshot of the queue metrics
queue
queue:batches-table Create a migration for the batches database table
queue:clear Delete all of the jobs from the specified queue
queue:failed List all of the failed queue jobs
queue:failed-table Create a migration for the failed queue jobs database table
queue:flush Flush all of the failed queue jobs
queue:forget Delete a failed queue job
queue:listen Listen to a given queue
queue:restart Restart queue worker daemons after their current job
queue:retry Retry a failed queue job
queue:retry-batch Retry the failed jobs for a batch
queue:table Create a migration for the queue jobs database table
queue:work Start processing jobs on the queue as a daemon
启动队列:
queue:work
有个参数 --stop-when-empty
可以让队列运行完成后退出。
运行中的队列
queue:restart
命令会等待队列中的 任务完成后 重启队列(优雅重启)。
此命令同样作用于 Supervisor 运行的 queue:work --daemon
,不过需要在 supervisor 的配置中加入 autorestart=true
进行设置。详见 队列 worker & 部署
优雅停止队列
目前 Laravel 8 未提供关闭队列的命令:
$ art | grep queue
horizon:clear Delete all of the jobs from the specified queue
horizon:forget Delete a failed queue job
horizon:snapshot Store a snapshot of the queue metrics
queue
queue:batches-table Create a migration for the batches database table
queue:clear Delete all of the jobs from the specified queue
queue:failed List all of the failed queue jobs
queue:failed-table Create a migration for the failed queue jobs database table
queue:flush Flush all of the failed queue jobs
queue:forget Delete a failed queue job
queue:listen Listen to a given queue
queue:restart Restart queue worker daemons after their current job
queue:retry Retry a failed queue job
queue:retry-batch Retry the failed jobs for a batch
queue:table Create a migration for the queue jobs database table
queue:work Start processing jobs on the queue as a daemon
启动队列:
queue:work
有个参数--stop-when-empty
可以让队列运行完成后退出。运行中的队列
queue:restart
命令会等待队列中的 任务完成后 重启队列(优雅重启)。此命令同样作用于 Supervisor 运行的
queue:work --daemon
,不过需要在 supervisor 的配置中加入autorestart=true
进行设置。详见 队列 worker & 部署优雅停止队列
目前 Laravel 8 未提供关闭队列的命令: