| | |
| | | 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) |
| | | |
| | | |
| | | # 设置过期时间 |
| | |
| | | |
| | | |
| | | def reset(code): |
| | | __big_money_cache[code] = 0 |
| | | RedisUtils.set(__redisManager.getRedis(), "big_money-{}".format(code), 0) |
| | | |
| | | |
| | |
| | | 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: |