mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-04 23:17:20 +08:00
refactor: unify module runtime settings
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
from typing import Tuple, Union
|
||||
|
||||
from app.runtime.config import settings
|
||||
from app.adapters.cache.redis import RedisHelper
|
||||
from app.modules import _ModuleBase
|
||||
from app.runtime.settings import RuntimeSettingsCompat
|
||||
from app.schemas.types import ModuleType, OtherModulesType
|
||||
|
||||
settings = RuntimeSettingsCompat()
|
||||
|
||||
|
||||
class RedisModule(_ModuleBase):
|
||||
"""
|
||||
@@ -12,10 +14,12 @@ class RedisModule(_ModuleBase):
|
||||
"""
|
||||
|
||||
def init_module(self) -> None:
|
||||
"""Redis 客户端由缓存 adapter 惰性管理,无需模块级初始化。"""
|
||||
pass
|
||||
|
||||
@staticmethod
|
||||
def get_name() -> str:
|
||||
"""返回模块展示名称。"""
|
||||
return "Redis缓存"
|
||||
|
||||
@staticmethod
|
||||
@@ -40,9 +44,11 @@ class RedisModule(_ModuleBase):
|
||||
return 0
|
||||
|
||||
def init_setting(self) -> Tuple[str, Union[str, bool]]:
|
||||
"""缓存后端由部署配置决定,不声明独立模块开关。"""
|
||||
pass
|
||||
|
||||
def stop(self) -> None:
|
||||
"""缓存 adapter 负责连接释放,本模块无独立资源。"""
|
||||
pass
|
||||
|
||||
def test(self):
|
||||
|
||||
Reference in New Issue
Block a user