问题描述
这是我的控制器操作:
public function export() {
(new ItemsExport)->queue('items.xlsx')->chain([
new ExportItemsEmail(auth()->user()),]);
return redirect()->back()->with('success','File will be emailed to you once done.');
}
超级简单,我们排队导出(有5k多条记录,可以更多)
class ItemsExport implements FromQuery,ShouldQueue {
use Exportable;
public function query() {
return Item::query();
}
}
再次没什么特别的。
问题:Horizon 失败
我在地平线上收到此错误:
Illuminate\Queue\MaxAttemptsExceededException:Maatwebsite\Excel\Jobs\AppendQueryToSheet 尝试次数过多或运行时间过长。该作业之前可能已超时。在 /home/adam/Documents/flare/vendor/laravel/framework/src/Illuminate/Queue/Worker.PHP:736
从 the docs 开始,这是假设将它分块并启动许多作业。我曾经在 Horizon 中看到 2-3 个工作像明天一样处于待处理状态,然后由于上述错误而在死亡之前留下来。
我做错了吗?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)