Administrator
2023-08-07 01a6c8606f5af8eaa328f562634a8950dd9d1f0d
code_attribute/gpcode_manager.py
@@ -576,6 +576,18 @@
    RedisUtils.setex(__redisManager.getRedis(), "price-{}".format(code), tool.get_expire(), price)
# datas:[(code,price)]
def set_prices(datas):
    pipe =  __redisManager.getRedis().pipeline()
    for d in datas:
        code, price = d[0], d[1]
        if code in __current_price_cache and __current_price_cache[code] == price:
            continue
        __current_price_cache[code] = price
        RedisUtils.setex(pipe, "price-{}".format(code), tool.get_expire(), price)
    pipe.execute()
# 获取正在监听的代码
def get_listen_codes():
    redis_instance = __redisManager.getRedis()