Administrator
2023-08-07 f0bd15f2eb0bf5539010c957c295af6ec1d50bf9
code_attribute/big_money_num_manager.py
@@ -18,8 +18,14 @@
        return False
__big_money_cache = {}
def add_num(code, num):
    RedisUtils.incrby(__redisManager.getRedis(), "big_money-{}".format(code), num)
    if code not in __big_money_cache:
        __big_money_cache[code] = 0
    __big_money_cache[code] += num
    RedisUtils.incrby_async(__redisManager.getRedis(), "big_money-{}".format(code), num)
# 设置过期时间
@@ -28,6 +34,7 @@
def reset(code):
    __big_money_cache[code] = 0
    RedisUtils.set(__redisManager.getRedis(), "big_money-{}".format(code), 0)
@@ -38,6 +45,14 @@
    return round(int(num) / 1000 / 4)
def get_num_cache(code):
    if code in __big_money_cache:
        return __big_money_cache[code]
    num = get_num(code)
    __big_money_cache[code] = num
    return num
def reset_all():
    redis = __redisManager.getRedis()
    try: