| | |
| | | global_util.max60_volumn[code] = (max60, max60_day) |
| | | global_util.yesterday_volumn[code] = yesterday |
| | | try: |
| | | RedisUtils.setex(redis, "volumn_max60-{}".format(code), tool.get_expire(), json.dumps((max60, max60_day)), auto_free=False) |
| | | RedisUtils.setex(redis, "volumn_max60-{}".format(code), tool.get_expire(), json.dumps((max60, max60_day)), |
| | | auto_free=False) |
| | | RedisUtils.setex(redis, "volumn_yes-{}".format(code), tool.get_expire(), yesterday, auto_free=False) |
| | | finally: |
| | | RedisUtils.realse(redis) |
| | |
| | | RedisUtils.setex( __redis_manager.getRedis(), "volumn_today-{}".format(code), tool.get_expire(), volumn) |
| | | |
| | | |
| | | # datas:[(code, volumn)] |
| | | def set_today_volumns(datas): |
| | | pipe = __redis_manager.getRedis().pipeline() |
| | | for d in datas: |
| | | code, volumn = d |
| | | logger_day_volumn.info("code:{} volumn:{}".format(code, volumn)) |
| | | global_util.today_volumn[code] = volumn |
| | | # 有1000手的变化才保存 |
| | | if code in __today_volumn_cache and volumn - __today_volumn_cache[code] < 100000: |
| | | continue |
| | | __today_volumn_cache[code] = volumn |
| | | RedisUtils.setex(pipe, "volumn_today-{}".format(code), tool.get_expire(), volumn) |
| | | pipe.execute() |
| | | |
| | | |
| | | # 获取今日量 |
| | | def get_today_volumn(code): |
| | | _volumn = global_util.today_volumn.get(code) |