0

I am using (carlos-meneses/laravel-mpdf) package for my Laravel 6 project. I have around 550 product for which I need to generate PDFs in two languages(English + Chinese). I have set up a queue job to generate the PDFs in the background, which gets run by a corn job.

But after a minute or so, the execution stops and throws 504 Error.

I have setup PHP max_execution_time = 600

But still, get timed out.

$products_with_pdf = ProductDetail::whereNotNull('en_document_url')->orWhereNotNull('zh_document_url')
        ->chunk(10, function ($products) {
            RegenerateAllPDFsOnDetailsUpdate::dispatch($products);
        });
Nauman Bashir
  • 101
  • 1
  • 7
  • 1
    Does this answer your question? [Fatal error: Maximum execution time of 30 seconds exceeded](https://stackoverflow.com/questions/5164930/fatal-error-maximum-execution-time-of-30-seconds-exceeded) – Tharindu Feb 08 '21 at 16:18
  • I had tried that already but it did not work. I get 504 - Gateway timeout Error in the end. – Nauman Bashir Feb 09 '21 at 08:07

1 Answers1

0

So, finally I found out that the queue driver was to "sync" by default. Changing it to "database" made it work.

Nauman Bashir
  • 101
  • 1
  • 7