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 | 17 +++++++++++++---- 1 files changed, 13 insertions(+), 4 deletions(-) diff --git a/strategy/check_timer.py b/strategy/check_timer.py index d61251c..6f41902 100644 --- a/strategy/check_timer.py +++ b/strategy/check_timer.py @@ -1,13 +1,15 @@ """ 瀹氫箟鏁翠釜椤圭洰鐨勫畾鏃跺櫒 """ -import datetime +# import datetime import time from log_module.log import logger_common -from strategy import data_cache +from strategy import data_cache, market_sentiment_analysis from strategy import kpl_api -from strategy import instant_time_market +from utils import tool + +# from strategy import instant_time_market # 鑾峰彇logger瀹炰緥 logger = logger_common @@ -23,7 +25,7 @@ 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: # 鏁寸悊褰撴棩娑ㄥ仠淇℃伅骞跺啓鍏ユ湰鍦扮鐞嗗ソ鏈湴鏁版嵁 @@ -34,6 +36,13 @@ 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