在Laravel 5.7中,我已经使用数据库队列运行了此程序,并且一切正常。另一方面,在使用Redis时,我遇到from collections import Counter
labels = ['05/Feb/2019', '05/Feb/2019', '05/Feb/2019', '01/Feb/2019']
values = ['2', '5', '7', '4']
c = Counter(l for l, v in zip(labels, values)
for _ in range(int(v)))
# Counter({'05/Feb/2019': 14, '01/Feb/2019': 4})
labels = list(c)
# ['05/Feb/2019', '01/Feb/2019']
values = list(c.values())
# [14, 4]
的问题。出于某些奇怪的原因:
public $queue
,则电子邮件将立即发送。 public $queue
,则会将邮件添加到默认队列中。我有一个类似于以下文件:
public $queue
使用<?php
namespace App\Mail;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
class TestEmail extends Mailable implements ShouldQueue
{
use Queueable, SerializesModels;
public $queue = 'mail';
}
类似于以下内容来调用邮件类:send()
当我切换到定义队列时,队列仍然不起作用:
Mail::to($request->user())->send(new OrderShipped($order));