From f324426b82216d30ffb6f3e57e82bb37efc2b985 Mon Sep 17 00:00:00 2001 From: Administrator <admin@example.com> Date: 星期五, 15 九月 2023 14:47:18 +0800 Subject: [PATCH] 订阅优化 --- code_attribute/code_volumn_manager.py | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/code_attribute/code_volumn_manager.py b/code_attribute/code_volumn_manager.py index c640c9e..dc14f4d 100644 --- a/code_attribute/code_volumn_manager.py +++ b/code_attribute/code_volumn_manager.py @@ -12,6 +12,7 @@ from db import redis_manager_delegate as redis_manager from log_module.log import logger_day_volumn +__db = 0 __redis_manager = redis_manager.RedisManager(0) @@ -63,7 +64,6 @@ # 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)) @@ -72,8 +72,7 @@ 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() + RedisUtils.setex_async(__db, "volumn_today-{}".format(code), tool.get_expire(), volumn) # 鑾峰彇浠婃棩閲� -- Gitblit v1.8.0