Open MichaelAkvo opened 2 years ago
For the PDF endpoint, we could move to using headless chromium for printing. Here's a stackoverflow script that uses selenium.
There are multiple ways to do this:
One off call
This means starting Chromium every time a PDF has to be printed. It adds a few seconds to the call.
Persistent background process
A persistent headless Chromium could be run in the background.
Printing services
Chromium is run another container. With a small HTTP process that receives the link to the page to print, Chromium could then open a tab, print it, and the HTTP process would send the PDF back as a response.
To get this "just working" we could start with the "one off" function. It'll be slow than the service, but probably much faster than the current printing process.
They are done asynchronously now, but it doesn't hurt to keep this open.
What were you doing?
What should've happened?
The PDF and excel should've been generated way more quickly, or at least done asynchronously (email with download link).
My environment
No response
Additional context
The endpoints called are:
py-reports/program/<projectID>/program-overview/?format=pdf&download=true&period_start={period_start}&period_end={period_end}
py-reports/program/<projectID>/program-overview-table/?format=excel&download=true&period_start={period_start}&period_end={period_end}