From ee0ce602722c91f92ee3de729ccd8a3f75f2352a Mon Sep 17 00:00:00 2001 From: Yanyutin753 <132346501+Yanyutin753@users.noreply.github.com> Date: Thu, 4 Apr 2024 10:27:47 +0800 Subject: [PATCH] fix BUG --- main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 77ef2b6..ca8d03f 100644 --- a/main.py +++ b/main.py @@ -614,7 +614,7 @@ def get_file_metadata(file_content, mime_type, api_key, proxy_api_prefix): sha256_hash = hashlib.sha256(file_content).hexdigest() logger.debug(f"sha256_hash: {sha256_hash}") # 首先尝试从Redis中获取数据 - cached_data = file_redis_client.get(sha256_hash) + cached_data = redis_client.get(sha256_hash) if cached_data is not None: # 如果在Redis中找到了数据,解码后直接返回 logger.info(f"从Redis中获取到文件缓存数据") @@ -653,7 +653,7 @@ def get_file_metadata(file_content, mime_type, api_key, proxy_api_prefix): new_file_data['height'] = height # 将新的文件数据存入Redis - file_redis_client.set(sha256_hash, json.dumps(new_file_data)) + redis_client.set(sha256_hash, json.dumps(new_file_data)) return new_file_data