Fix 502 after update: safe startup, single DB init, healthcheck
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -25,6 +25,15 @@ from app.upload_service import process_uploads
|
||||
bp = Blueprint("main", __name__)
|
||||
|
||||
|
||||
@bp.route("/health")
|
||||
def health():
|
||||
try:
|
||||
db.session.execute(db.text("SELECT 1"))
|
||||
return {"status": "ok"}, 200
|
||||
except Exception as exc:
|
||||
return {"status": "error", "detail": str(exc)}, 503
|
||||
|
||||
|
||||
@bp.route("/")
|
||||
def index():
|
||||
photos = Photo.query.order_by(Photo.created_at.desc()).limit(24).all()
|
||||
|
||||
Reference in New Issue
Block a user