From a3c05bddc4c61d63b804ee541cf6dd01717ba94d Mon Sep 17 00:00:00 2001 From: Administrator <admin@example.com> Date: 星期三, 02 八月 2023 16:39:08 +0800 Subject: [PATCH] redis封装 --- inited_data.py | 13 +++++++------ 1 files changed, 7 insertions(+), 6 deletions(-) diff --git a/inited_data.py b/inited_data.py index 0a855df..ba0be36 100644 --- a/inited_data.py +++ b/inited_data.py @@ -9,6 +9,7 @@ import gm.api as gmapi from code_attribute import big_money_num_manager, global_data_loader, gpcode_manager, gpcode_first_screen_manager +from db.redis_manager import RedisUtils from ths import client_manager import constant from utils import global_util, tool @@ -35,16 +36,16 @@ # 璁剧疆璐︽埛淇℃伅 def setAccountInfo(accountId, strategyId, token): redis = redisManager.getRedis() - redis.set("juejin-account-id", accountId) - redis.set("juejin-strategy-id", strategyId) - redis.set("juejin-token", token) + RedisUtils.set(redis,"juejin-account-id", accountId) + RedisUtils.set(redis,"juejin-strategy-id", strategyId) + RedisUtils.set( redis, "juejin-token", token) def getAccountInfo(): redis = redisManager.getRedis() - account_id = redis.get("juejin-account-id") - strategy_id = redis.get("juejin-strategy-id") - token = redis.get("juejin-token") + account_id =RedisUtils.get( redis, "juejin-account-id") + strategy_id = RedisUtils.get(redis, "juejin-strategy-id") + token = RedisUtils.get(redis, "juejin-token") return account_id, strategy_id, token -- Gitblit v1.8.0