From 8595dc22aa9dde6aba6d0f8cdcf1656a8a59513b Mon Sep 17 00:00:00 2001 From: Administrator <admin@example.com> Date: 星期三, 02 八月 2023 18:05:10 +0800 Subject: [PATCH] redis封装 --- code_attribute/code_volumn_manager.py | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/code_attribute/code_volumn_manager.py b/code_attribute/code_volumn_manager.py index 122657e..23bb5f8 100644 --- a/code_attribute/code_volumn_manager.py +++ b/code_attribute/code_volumn_manager.py @@ -30,11 +30,11 @@ yesterday = global_util.yesterday_volumn.get(code) redis = __redis_manager.getRedis() if max60 is None: - max60 = redis.get("volumn_max60-{}".format(code)) + max60 = RedisUtils.get(redis, "volumn_max60-{}".format(code)) if max60: max60 = json.loads(max60) if yesterday is None: - yesterday = redis.get("volumn_yes-{}".format(code)) + yesterday = RedisUtils.get(redis, "volumn_yes-{}".format(code)) return max60, yesterday @@ -51,7 +51,7 @@ _volumn = global_util.today_volumn.get(code) if _volumn is None: redis = __redis_manager.getRedis() - _volumn = redis.get("volumn_today-{}".format(code)) + _volumn = RedisUtils.get(redis, "volumn_today-{}".format(code)) return _volumn @@ -96,7 +96,7 @@ if keys is not None: for k in keys: code = k.split("-")[1] - max60_volumn = redis.get(k) + max60_volumn = RedisUtils.get(redis, k) if max60_volumn: max60_volumn = json.loads(max60_volumn) global_util.max60_volumn[code] = max60_volumn @@ -104,7 +104,7 @@ if keys is not None: for k in keys: code = k.split("-")[1] - global_util.yesterday_volumn[code] = redis.get(k) + global_util.yesterday_volumn[code] = RedisUtils.get(redis, k) if __name__ == "__main__": -- Gitblit v1.8.0