de0b3ccdbc40507a438057672e1bea2d3281fddd
Changed app.py: • process_pft_pdf() now uses the uploaded file stream directly instead of copying the PDF into bytes. • Output now uses SpooledTemporaryFile, so larger generated PDFs spill to disk instead of staying fully in RAM. • Explicitly closes PdfReader objects after writing. • Removed @app.teardown_request gc.collect(), which was running too early and could break send_file. • Added response.call_on_close() cleanup so the generated PDF stream is closed only after Flask/Werkzeug finishes sending it. Changed Dockerfile: • Added Gunicorn --max-requests 50 --max-requests-jitter 10 as a production guardrail against PDF-library or allocator memory growth.
Description
Python3 Flask app to parse PFT pdf, fill, and sign template reports. Include Google Apps Script to automate processing
360 KiB
Languages
Python
70.6%
JavaScript
26.4%
Dockerfile
3%