Files
MoviePilot/app/sdk/cache.py
2026-09-29 20:07:34 +08:00

46 lines
988 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""插件可用的缓存契约、适配器工厂和装饰器。"""
from app.adapters.cache.backends import (
AsyncFileBackend,
FileBackend,
)
from app.runtime.cache import (
AsyncCache,
AsyncCacheBackend,
AsyncFileCache,
AsyncMemoryBackend,
AtomicCacheBackend,
Cache,
CacheBackend,
FileCache,
LRUCache,
MemoryBackend,
TTLCache,
async_fresh,
cached,
fresh,
is_fresh,
)
# RedisBackend / AsyncRedisBackend 由兼容层惰性解析到 app.adapters.cache.redis,显式导入仍可用;
# 不列入星号导出,避免文件缓存实例因 ``import *`` 加载 redis 客户端库。
__all__ = [
"AtomicCacheBackend",
"AsyncCache",
"AsyncCacheBackend",
"AsyncFileBackend",
"AsyncFileCache",
"AsyncMemoryBackend",
"Cache",
"CacheBackend",
"FileBackend",
"FileCache",
"LRUCache",
"MemoryBackend",
"TTLCache",
"async_fresh",
"cached",
"fresh",
"is_fresh",
]