testing entrypoint

This commit is contained in:
2025-06-06 21:08:19 +02:00
parent fd34dd20ca
commit fc05fda666
2 changed files with 51 additions and 50 deletions

14
app.py
View File

@@ -76,9 +76,21 @@ def create_app():
@app.route('/health')
def health_check():
try:
# Check database connection
# Check database connection with a timeout
db.session.execute(text('SELECT 1'))
db.session.commit()
# Check if we can actually query a table
try:
User.query.first()
except Exception as e:
app.logger.error(f"Database query failed: {str(e)}")
return jsonify({
'status': 'unhealthy',
'error': f"Database query failed: {str(e)}",
'timestamp': datetime.utcnow().isoformat()
}), 500
return jsonify({
'status': 'healthy',
'database': 'connected',