Update main.py
Browse files
main.py
CHANGED
|
@@ -331,14 +331,14 @@ def approve_user_phone():
|
|
| 331 |
if __name__ == '__main__':
|
| 332 |
port = int(os.environ.get("PORT", 7860))
|
| 333 |
debug_mode = os.environ.get("FLASK_DEBUG", "False").lower() == "true"
|
| 334 |
-
|
| 335 |
if not db:
|
| 336 |
-
|
| 337 |
else:
|
| 338 |
if not debug_mode:
|
| 339 |
from waitress import serve
|
| 340 |
-
|
| 341 |
serve(app, host="0.0.0.0", port=port)
|
| 342 |
else:
|
| 343 |
-
|
| 344 |
app.run(debug=True, host="0.0.0.0", port=port)
|
|
|
|
| 331 |
if __name__ == '__main__':
|
| 332 |
port = int(os.environ.get("PORT", 7860))
|
| 333 |
debug_mode = os.environ.get("FLASK_DEBUG", "False").lower() == "true"
|
| 334 |
+
logging.info(f"Starting Flask app. Debug mode: {debug_mode}, Port: {port}")
|
| 335 |
if not db:
|
| 336 |
+
logging.critical("Firestore client failed to initialize. Application cannot run.")
|
| 337 |
else:
|
| 338 |
if not debug_mode:
|
| 339 |
from waitress import serve
|
| 340 |
+
logging.info("Running in production mode using Waitress.")
|
| 341 |
serve(app, host="0.0.0.0", port=port)
|
| 342 |
else:
|
| 343 |
+
logging.info("Running in debug mode using Flask development server.")
|
| 344 |
app.run(debug=True, host="0.0.0.0", port=port)
|