From 106aafe2a993f291bcec9edd6b87bed0699a4874 Mon Sep 17 00:00:00 2001 From: admin Date: Thu, 12 Mar 2026 13:21:53 +0800 Subject: [PATCH] fix: add eventlet monkey_patch and favicon route --- src/app.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/app.py b/src/app.py index f50c7b2b6..6076302fd 100644 --- a/src/app.py +++ b/src/app.py @@ -2,12 +2,15 @@ TCKRTUIYO - Rainfall Station RTU Web Interface Flask Backend with SocketIO for Real-Time Updates """ +import eventlet +eventlet.monkey_patch() + import os import json import time import threading from datetime import datetime -from flask import Flask, render_template, jsonify, request +from flask import Flask, render_template, jsonify, request, send_from_directory from flask_socketio import SocketIO, emit # Configuration @@ -18,6 +21,11 @@ app.config['JSON_SORT_KEYS'] = False # SocketIO with eventlet for production performance socketio = SocketIO(app, cors_allowed_origins="*", async_mode='eventlet') +# Favicon route +@app.route('/favicon.ico') +def favicon(): + return send_from_directory(os.path.join(os.path.dirname(__file__), 'static'), 'logo/[LOGO] TCK.svg', mimetype='image/svg+xml') + # Data paths DATA_DIR = os.path.join(os.path.dirname(__file__), 'data') SETTINGS_FILE = os.path.join(DATA_DIR, 'settings.json')