Slim embed tab rendering to cut memory use and restore calculator.

Load only per-tab data for embed fragments, skip exchange capital fetches on tab switches, and harden calculator market imports/timeouts.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-24 01:33:42 +08:00
parent bced61b9d7
commit 384d404bb3
8 changed files with 380 additions and 109 deletions
+5 -2
View File
@@ -10,12 +10,15 @@ import urllib.request
from typing import Any, Callable, Optional, Tuple
from urllib.parse import urlencode
from manual_trading_hub.settings_store import enabled_exchanges, load_settings
try:
from settings_store import enabled_exchanges, load_settings
except ImportError:
from manual_trading_hub.settings_store import enabled_exchanges, load_settings
MARKET_CACHE: dict[str, tuple[float, dict[str, Any]]] = {}
MARKET_LOCK = threading.Lock()
MARKET_TTL_SEC = 300.0
HUB_FLASK_TIMEOUT = float(__import__("os").getenv("HUB_FLASK_TIMEOUT", "12"))
HUB_FLASK_TIMEOUT = float(__import__("os").getenv("HUB_FLASK_TIMEOUT", "20"))
def normalize_base_symbol(text: str) -> str: