a7220d27f52b2619f6099953e61c9fa785237c3c
PIL img.resize() on high-resolution photos was exhausting worker RAM,
causing Gunicorn to SIGKILL the worker mid-request (production OOM crash).
Replace the explicit resize() path in both _compress_image_for_pdf() and
_compress_image_for_docx() with:
- Image.draft() — hints the JPEG decoder to decode at a lower resolution
- Image.thumbnail() — in-place resize that avoids allocating a second
full-resolution buffer
This keeps peak memory proportional to the output size instead of the
original file size, preventing the worker from being killed when
processing multi-megapixel service-record photos.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Frontend + Backend + Database + Deployment
Deploy na serveru
Nakon što je gitea webhook i testirana skripta za automatsko povlačenje promjena iz repozitorija
cd /opt/erp/app
git fetch origin
git reset --hard origin/main
# rebuild backend + worker + beat + frontend
docker compose -f docker-compose.yml -f docker-compose.prod.yml build backend worker beat frontend
# digni servise s novim image-ima
docker compose -f docker-compose.yml -f docker-compose.prod.yml up -d --force-recreate backend worker beat frontend
# OBAVEZNO migracije (scheduled_date)
docker compose -f docker-compose.yml -f docker-compose.prod.yml exec backend python manage.py migrate
# provjera
curl -i https://api-004.captain.mitteworkspace.cloud/api/health/
Description
Languages
Python
51%
JavaScript
47.1%
TypeScript
0.8%
Astro
0.6%
CSS
0.3%