Force-refresh header balances after transfers and balance SSE events.

Invalidate balance caches on mutation, push SSE balance tick, and bypass 60s cache when refreshing funds.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-12 09:03:15 +08:00
parent bb53beb22d
commit 5eb9b9f5c5
10 changed files with 63 additions and 13 deletions
+5
View File
@@ -100,6 +100,11 @@ class InstanceLivePush:
instance_live_push = InstanceLivePush()
def notify_instance_balance_changed() -> int:
"""划转/兑换后通知 embed 壳拉最新资金快照."""
return instance_live_push.tick("balance")
def register_instance_live_routes(app: Flask, login_required: Callable) -> None:
instance_live_push.start()