Closed maxacarvalho closed 4 years ago
Any help here @patrickbrouwers ? Ps.: Please forgive me to mention you directly but I'm a bit lost with the problem.
Have you checked the queue:work output? Does it call multiple jobs?
Hello @patrickbrouwers thanks for your reply.
I'm using Horizon, and I can confirm that it calls only one job. That's weird, I expect to see multiple so it process each batch at a time.
Does the one job not have a chain attached to it?
Hi @patrickbrouwers
I'm not sure I understood your question, I simply call the exporter like:
(new PatientScheduleExport($filters))->store('export.xlsx');
But it does not trigger the necessary next chunks. If I increase the chunk size it exports that number, so only the first chunk is included. I understand that the exporter should create as many jobs as necessary to finish all the chunks no?
I meant if you open Horizon job details, can you see a chain in the payload?
I'm testing locally now. Once I trigger the job with (new PatientScheduleExport(collect([])))->store('export.xlsx');
I can see that it creates 4 jobs on Redis:
So it seems that's not sending the correct number of jobs?
The weird thing is that I recall this was working before, I could export all my records without a problem.
It should have more AppendQueryToSheet jobs I think. Not sure why it doesn't work for you anymore. You might have to dive into the code that builds up the job chain. Maybe the count query that determines the amount of jobs is wrong for your query.
Hummm yeah, that count issue rings a bell. I will have a look on that. Thanks for your help so far @patrickbrouwers !!!
Have a look at this documentation section: https://docs.laravel-excel.com/3.1/exports/queued.html#custom-query-size
@patrickbrouwers that's it!
My colleague changed the query and it now includes a group by
, so that's probably messing with the count.
I will fix it by following your advice and use the WithCustomQuerySize
concern.
Thank you very much!!!
You're welcome, glad we figured it out :)
Hello guys, I'm facing the same issue here and I did custom query size and using WithCustomQuerySize concern but still got only the first chuck!
Hello guys, I'm facing the same issue here and I did custom query size and using WithCustomQuerySize concern but still got only the first chuck!
maybe your chunk size is too small?
I have same problem with Maatwebsite\LaravelNovaExcel
Prerequisites
Versions
7.4
7.27
3.1.21
Description
I have an export that relies on a query, the export works fine except that it only includes the first chunk, or first batch.
For example, if the Laravel-Excel
chunk_size
configuration is set to1000
the generated file will be 1000, if I set to2000
it will be2000
and so on.I already tried generating an Excel file and a CSV file, the issue is the same.
I searched on the GitHub issues a lot and I could not find anything that points me to a solution.
Additional Information
Here's my export:
And here's the
toExport
query you see I'm calling above (I omitted some query details cause I don't think they are necessary):Thanks!