Laravel调度队列中间始终运行

问题描述 投票:0回答:1

我试图派遣在Laravel工作到MySQL。如果我做

调度(新SendBroadcastSMS());

要么

SendBroadcastSMS ::调度() - >延迟(现在的() - > addMinutes(2));

这项工作始终运行中间。在我的工作,我设置为休眠30秒,我的电流控制器/页调用调度也在等待30秒和回声作业返回。为什么?它应该通过工人权利的后台运行?或者我与laravel队列误解?

我的工作是象下面这样:

<?php

namespace App\Jobs;

use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;

class SendBroadcastSMS implements ShouldQueue
{
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;

    public function __construct()
    {
    }
    public function handle()
    {
        sleep(30);
        echo "test";
//       dd($this->sendSms("6281517777767","test message"));
        //
    }
}

我的队列驱动程序数据库MySQL的,我也没有收到qazxsw POI表中的任何行

QUEUE_DRIVER =数据库

laravel queue dispatch
1个回答
0
投票

job是不是你应该在你QUEUE_DRIVER文件中设置的属性。 正确的属性是.env

QUEUE_CONNECTION
© www.soinside.com 2019 - 2024. All rights reserved.