Administrator
2023-08-03 500e2f3db6ce9ab2f6f06e7b3b23ce15f71db59d
code_attribute/gpcode_first_screen_manager.py
@@ -17,6 +17,9 @@
    return __redisManager.getRedis()
__first_code_data_cache = {}
# 保存首板票的数据
# 1.首次涨停时间
# 2.最近涨停时间
@@ -24,6 +27,7 @@
# 4.最近炸开时间
# 5.是否已经涨停
def __save_first_code_data(code, data):
    tool.CodeDataCacheUtil.set_cache(__first_code_data_cache, code, data)
    RedisUtils.setex(__redisManager.getRedis(), f"first_code_data-{code}", tool.get_expire(), json.dumps(data))
@@ -32,6 +36,15 @@
    if val is None:
        return None
    return json.loads(val)
def __get_first_code_data_cache(code):
    cache_result = tool.CodeDataCacheUtil.get_cache(__first_code_data_cache, code)
    if cache_result[0]:
        return cache_result[1]
    val = __get_first_code_data(code)
    tool.CodeDataCacheUtil.set_cache(__first_code_data_cache, code, val)
    return val
# 添加进首板未筛选票
@@ -67,7 +80,7 @@
    for price in prices:
        code = price["code"]
        time_ = price["time"]
        old_data = __get_first_code_data(code)
        old_data = __get_first_code_data_cache(code)
        if old_data is None:
            continue
        limit_up = price["limit_up"]