mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-08-28 03:27:31 +08:00
refactor:重构缓存系统
This commit is contained in:
@@ -51,9 +51,10 @@ class RedisModule(_ModuleBase):
|
||||
"""
|
||||
if settings.CACHE_BACKEND_TYPE != "redis":
|
||||
return None
|
||||
redis_helper = RedisHelper()
|
||||
try:
|
||||
redis_helper = RedisHelper(redis_url=settings.CACHE_BACKEND_URL)
|
||||
if redis_helper.test():
|
||||
return True, ""
|
||||
return False, "Redis连接失败,请检查配置"
|
||||
finally:
|
||||
redis_helper.close()
|
||||
except RuntimeError as e:
|
||||
return False, f"Redis连接失败:{e}"
|
||||
return True, ""
|
||||
|
||||
Reference in New Issue
Block a user