Fix worker crash: remove broken gunicorn post_fork hook

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-06 23:02:32 +03:00
parent e334a7b32c
commit b014e64c5d
4 changed files with 31 additions and 24 deletions
+7 -3
View File
@@ -2,6 +2,7 @@ import os
from flask import (
Blueprint,
Response,
abort,
current_app,
flash,
@@ -21,6 +22,7 @@ from app.models import Folder, Photo
from app.settings_service import get_settings
from app.storage_service import delete_photo_file, get_photo_stream
from app.upload_service import process_uploads
from sqlalchemy import text
bp = Blueprint("main", __name__)
@@ -28,10 +30,12 @@ bp = Blueprint("main", __name__)
@bp.route("/health")
def health():
try:
db.session.execute(db.text("SELECT 1"))
return {"status": "ok"}, 200
db.session.execute(text("SELECT 1"))
db.session.remove()
return Response("ok\n", mimetype="text/plain")
except Exception as exc:
return {"status": "error", "detail": str(exc)}, 503
db.session.remove()
return Response(f"error: {exc}\n", status=503, mimetype="text/plain")
@bp.route("/")