No description
Find a file
Cipher Vance 6bf6d15fbe Refactor email sending for non-blocking performance and add request timing
• Dockerfile: bump Gunicorn workers to 4 for concurrent request handling
• server.py:

- Load SMTP credentials once at startup
- Wrap send_confirmation_email in a daemon Thread for “fire-and-forget” delivery
- Replace print() with structured app.logger.error() on failure
- Add before_request/after_request hooks to log per-request durations
- Use context manager for SMTP_SSL connections (auto-close)
- Simplify route JSON responses and HTTP methods declarations
- Retain existing DB logic but recommend low DB connect_timeouts
- Ensure Flask binds on 0.0.0.0 in development
These changes eliminate request blocking on email I/O, expose request latencies in logs, and improve overall concurrency.
2025-08-25 12:30:25 -05:00
.idea Slow overhaul of the landing page 2025-02-05 08:07:56 -06:00
__pycache__ Slow overhaul of the landing page 2025-02-05 08:07:56 -06:00
static feat: added main.min.js 2025-08-25 08:20:32 -05:00
templates style: using a CDN now for css 2025-08-25 11:51:15 -05:00
.gitignore fix: Fixed venv being added to commits 2025-02-19 12:25:57 -06:00
database.py feat(newsletter): add newsletters listing and detail pages 2025-02-18 20:07:30 -06:00
Dockerfile Refactor email sending for non-blocking performance and add request timing 2025-08-25 12:30:25 -05:00
requirements.txt (feat): Added production level deployment 2025-02-13 19:14:07 +00:00
server.py Refactor email sending for non-blocking performance and add request timing 2025-08-25 12:30:25 -05:00