From dc36d72459ea92e4c78e2a2eefb5655e82a3d459 Mon Sep 17 00:00:00 2001 From: Administrator <admin@example.com> Date: 星期二, 04 六月 2024 23:52:26 +0800 Subject: [PATCH] 9:25之前的开1订阅 --- l2_data_util.py | 19 ++++++++----------- 1 files changed, 8 insertions(+), 11 deletions(-) diff --git a/l2_data_util.py b/l2_data_util.py index 881abf8..1451127 100644 --- a/l2_data_util.py +++ b/l2_data_util.py @@ -7,7 +7,7 @@ import json import time -from db.redis_manager import RedisUtils +from db.redis_manager_delegate import RedisUtils from utils.tool import async_call from l2 import l2_data_manager @@ -32,7 +32,7 @@ price = float(val["price"]) money = price * val["num"] if price > 3.0: - if money >= 30000: + if money >= 29900 or val["num"] >= 7999: return True else: return False @@ -47,7 +47,7 @@ # 鑾峰彇澶ц祫閲戠殑閲戦 def get_big_money_val(limit_up_price): if limit_up_price > 3.0: - return 300 * 10000 + return min(299 * 10000, round(limit_up_price * 7999)) else: max_money = limit_up_price * 10000 return max_money * 0.95 @@ -179,30 +179,27 @@ if abs(get_time_as_seconds(time_str) - get_time_as_seconds(time_)) > 3: continue if same_time_nums[time_] > 20: - redis = l2_data_manager._redisManager.getRedis() - RedisUtils.setex(redis, "big_data-{}-{}".format(code, int(round(time.time() * 1000))), tool.get_expire(), + RedisUtils.setex(l2_data_manager._redisManager.getRedis(), + "big_data-{}-{}".format(code, int(round(time.time() * 1000))), tool.get_expire(), d1) break # 淇濆瓨l2鏈�鏂版暟鎹殑澶у皬 -# TODO 娴嬭瘯鏁版嵁 # @async_call def save_l2_latest_data_number(code, num): - redis = l2_data_manager._redisManager.getRedis() - RedisUtils.setex(redis, "l2_latest_data_num-{}".format(code), 3, num) + RedisUtils.setex(l2_data_manager._redisManager.getRedis(), "l2_latest_data_num-{}".format(code), 3, num) # 鑾峰彇鏈�鏂版暟鎹潯鏁� def get_l2_latest_data_number(code): - redis = l2_data_manager._redisManager.getRedis() - num = redis.get("l2_latest_data_num-{}".format(code)) + num = RedisUtils.get(l2_data_manager._redisManager.getRedis(), "l2_latest_data_num-{}".format(code)) if num is not None: return int(num) return None -# l2鏁版嵁鎷兼帴宸ュ叿 TODO 鏆傛椂杩樻湭鍚敤 +# l2鏁版嵁鎷兼帴宸ュ叿 鏆傛椂杩樻湭鍚敤 class L2DataConcatUtil: # 鍒濆鍖� -- Gitblit v1.8.0