Laravel失败时自动重试通知

时间:2019-06-14 15:06:21

标签: php laravel laravel-5 eloquent laravel-horizon

我使用Laravel Horizo​​n,并将通知按如下方式放置:

# Notifies the user that the transfer was made
$transfer->user->notify((new ConfirmedTransfer($transfer))->queue('default'));

问题在于,当发生错误时,Horizo​​n不会自动重试。 该怎么做?

1 个答案:

答案 0 :(得分:1)

使用工作:

在此处了解更多信息:https://laravel.com/docs/5.8/queues#generating-job-classes

class TransferJob implements ShouldQueue
{
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
    public $tries = 5;

}