From 70b51a2636858fb8cfbf39d3764d88d07286d8ad Mon Sep 17 00:00:00 2001
From: admin <admin@example.com>
Date: 星期二, 08 四月 2025 11:27:42 +0800
Subject: [PATCH] 增加并行数量

---
 strategy/check_timer.py |   26 ++++++++++++++++++--------
 1 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/strategy/check_timer.py b/strategy/check_timer.py
index 052f32d..6f41902 100644
--- a/strategy/check_timer.py
+++ b/strategy/check_timer.py
@@ -1,15 +1,18 @@
 """
 瀹氫箟鏁翠釜椤圭洰鐨勫畾鏃跺櫒
 """
-import datetime
+# import datetime
 import time
-from strategy import data_cache
+
+from log_module.log import logger_common
+from strategy import data_cache, market_sentiment_analysis
 from strategy import kpl_api
-from strategy import instant_time_market
-from strategy.logging_config import get_logger
+from utils import tool
+
+# from strategy import instant_time_market
 
 # 鑾峰彇logger瀹炰緥
-logger = get_logger()
+logger = logger_common
 
 
 # 鏋勫缓涓�涓」鐩暣浣撶殑瀹氭椂鍣ㄥ璞�
@@ -22,17 +25,24 @@
     while True:
         try:
             # 澹版槑璧嬪�煎疄鏃舵椂闂�
-            now_time = datetime.datetime.now().strftime("%H:%M:%S")
+            now_time = tool.get_now_time_str()
             # print(f"now_time==={now_time}")
-            if now_time > data_cache.after_closing_time and data_cache.execution is False:
+            if now_time > data_cache.AFTER_CLOSING_TIME and data_cache.execution is False:
                 # 鏁寸悊褰撴棩娑ㄥ仠淇℃伅骞跺啓鍏ユ湰鍦扮鐞嗗ソ鏈湴鏁版嵁
                 kpl_api.get_arrange_limit_up_info()
                 logger.info(f"鏁寸悊褰撴棩娑ㄥ仠淇℃伅 宸茬粡杩愯瀹屾垚")
                 # # 鑾峰彇鎵�鏈変釜鑲$殑鏉垮潡姒傚康骞跺啓鍏ユ枃浠躲�愯�楁椂杈冮暱搴旇鏀惧湪 鏍稿績涓荤嚎绋� 鍜� 浠撲綅绠$悊 鍚庨潰銆�
-                kpl_api.get_all_stocks_plate_dict(data_cache.DataCache.filtered_stocks)
+                kpl_api.get_all_stocks_plate_dict(data_cache.DataCache().filtered_stocks)
                 logger.info(f"鑾峰彇鎵�鏈変釜鑲$殑鏉垮潡姒傚康 宸茬粡杩愯瀹屾垚")
                 # 瀹屾垚浜嗗悗灏嗘槸鍚︽墽琛岀殑寮�涓爣璁颁负鐪�
                 data_cache.execution = True
+            # 鏈湴鏁版嵁鏇存柊鏃堕棿
+            if data_cache.UPDATE_DATA_TIME < now_time and data_cache.index_K_line_write_execution is False:
+                # 鍐欏叆鎵�鏈夋寚鏁癒绾�
+                market_sentiment_analysis.all_index_k_line_dict_write()
+                logger.info(f"鍐欏叆鎵�鏈夊甫灞炴�ф寚鏁癒绾� 宸茬粡杩愯瀹屾垚")
+                # 瀹屾垚浜嗗悗灏嗘槸鍚︽墽琛岀殑寮�涓爣璁颁负鐪�
+                data_cache.index_K_line_write_execution = True
         except Exception as error:
             logger.error(f"瀹炴椂妫�娴嬪畾鏃跺櫒绾跨▼鎶ラ敊: {error}")
         finally:

--
Gitblit v1.8.0