Преглед на файлове

perf: 将Binance数据收集请求间隔从100ms调整为200ms

降低请求频率以减少API调用压力,同时仍保持足够的数据更新频率
skyfffire преди 1 седмица
родител
ревизия
7cc66206e2
променени са 1 файла, в които са добавени 3 реда и са изтрити 3 реда
  1. 3 3
      src/record/market_data_recorder.py

+ 3 - 3
src/record/market_data_recorder.py

@@ -155,7 +155,7 @@ async def fetch_binance_ticker_price(session):
 
 
 async def handle_binance_data_collection():
-    """处理Binance数据收集的主循环,每100ms请求一次"""
+    """处理Binance数据收集的主循环,每200ms请求一次"""
     logger.info("开始Binance数据收集任务")
     
     while True:
@@ -184,8 +184,8 @@ async def handle_binance_data_collection():
                         if symbol and price:
                             binance_data_cache['latest_prices'][symbol] = float(price)
                 
-                # 每100ms请求一次
-                await asyncio.sleep(0.1)
+                # 每200ms请求一次
+                await asyncio.sleep(0.2)
                 
         except Exception as e:
             logger.error(f"Binance数据收集出错: {str(e)}")