coletiv / puppeteer-pdf

PDF generation wrapper for Elixir using Puppeteer
MIT License
97 stars 18 forks source link

I'm getting timeout 5000ms #7

Closed jay-meister closed 5 years ago

jay-meister commented 5 years ago

I'm just testing this to see if it can improve my PDF merge speed compared to using PDFTK.

I'm running into the following error:

[error] Reason: {:timeout, {Task, :await, [%Task{owner: #PID<0.5032.0>, pid: #PID<0.5062.0>, ref: #Reference<0.2073999233.3028025346.67786>}, 5000]}}
[error] Stack: [
{Task, :await, 2, [file: 'lib/task.ex', line: 515]}, 
{Ev2Web.OfferController, :index, 2, [file: 'lib/ev2_web/controllers/offer_controller.ex', line: 132]}
...

I wonder if we can have a configurable :timeout option?

Would be happy to PR if you give go ahead.

jay-meister commented 5 years ago

For reference this is the template that I am generating and converting to PDF:

<%= for _ <- 1..100 do %>
  <div class="bg-yellow h1 w1">
    <div class="h1">
      <%= for _ <- 1..100 do %>
        offer: <%= hd(@proj_offers).target_email %>
        <br>
      <% end %>
    </div>
  </div>
  <br>
  <div style="page-break-after:always;"></div>
<% end %>

So that's a 100 page document, but each page is simple with 100 lines of data.

speeddragon commented 5 years ago

Hi Jack, having a timeout setting seems to be a good option, if you can create PR go ahead.

Can you also provide more detail about the comparison with PDFTK ?

jay-meister commented 5 years ago

Will do tomorrow. Cheers!

jay-meister commented 5 years ago

@speeddragon sorry I got distracted. PR coming today/tomorrow.