doubi5520 2019-07-12 12:49
浏览 921

尽管使用了--tries,Laravel队列也不会自动失败

I'm want to queue some jobs using Redis,so I made an Event and its Listener.

The Listener implements ShouldQueue. I deliberately throw exception to test whether it fails. By entering the the command php artisan queue:work --tries=3 it should try the job 3 times and if it can't be done, add it to failed-jobs right? but it doesn't do so. I tried using database driver but nothing changed.

One time I used php artisan queue:work --tries=3 --daemon despite the fact that --daemon is deprecated, and after 3 tries,the job was marked as failed - but when I stopped the command and ran it again, it didn't fail again.

why is this happening? Thanks in advance :)

  • 写回答

1条回答 默认 最新

  • dongmijgnnq0118 2019-07-14 11:54
    关注

    I think you should deal with the failed jobs and check for the reasons , I suggest Adding Failed_jobs Table and check for failure reasons run theses commands to use that

    php artisan queue:failed-table
    
    php artisan migrate
    

    Then try

    php artisan queue:work redis --tries=3 --delay=3
    

    If the job failed check the failed jobs table

    评论

报告相同问题?

悬赏问题

  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容