小编Ali*_*Ali的帖子

为什么 Laravel 队列忽略我的超时值?

为什么我的队列作业超时?我使用数据库作为驱动程序我尝试了以下操作:

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

    protected $userData;
    protected $filename;
    protected $path;
    public $timeout = 1200;
    /**
     * Create a new job instance.
     *
     * @return void
     */
    public function __construct($userData, $filename)
    {
        //
        $this->userData = $userData;
        $this->filename = $filename;
        $this->path = \public_path('\\pdfs\\'.$this->filename.'.pdf');
    }

    /**
     * Execute the job.
     *
     * @return void
     */
    public function handle()
    {
        $pdf = App::make('snappy.pdf.wrapper');
        $footer = \view('supporting.footer')->render();
        $header = \view('supporting.header')->render();
        //$userData = \collect([$this->userData[1]]);
        $pdf->loadView('order_clean', ['users' => $this->userData])
        ->setOption('margin-top', …
Run Code Online (Sandbox Code Playgroud)

php task-queue laravel laravel-8

5
推荐指数
1
解决办法
3794
查看次数

标签 统计

laravel ×1

laravel-8 ×1

php ×1

task-queue ×1