增加资金费率

This commit is contained in:
dekun
2026-05-22 14:00:19 +08:00
parent d7f7259ee0
commit 71ed38b32d
13 changed files with 603 additions and 14 deletions
+3
View File
@@ -11,6 +11,7 @@ from .db import get_latest_snapshot, init_db, log_push, save_snapshot, was_pushe
from .exceptions import BinanceRateLimitedError
from .periods import get_today_period, get_yesterday_period, now_shanghai
from .state import get_today_cache, set_today_cache
from .funding_store import prefetch_funding
from .kline_store import prefetch_symbols
from .wecom import build_markdown, send_wecom_markdown
@@ -57,6 +58,7 @@ async def job_finalize_yesterday() -> None:
syms = [x["symbol"] for x in items if x.get("symbol")]
if syms:
await prefetch_symbols(syms)
await prefetch_funding(syms)
except BinanceRateLimitedError as e:
logger.error("Finalize yesterday rate limited %ss", e.retry_after_sec)
except Exception as e:
@@ -120,6 +122,7 @@ async def job_refresh_today() -> None:
syms = [x["symbol"] for x in items if x.get("symbol")]
if syms:
await prefetch_symbols(syms)
await prefetch_funding(syms)
except BinanceRateLimitedError as e:
logger.error("Refresh today rate limited %ss — use cache", e.retry_after_sec)
_restore_today_from_db()