mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-07-27 08:47:00 +08:00
feat(deps): add uv-backed package installer (#5987)
* feat(deps): add uv-backed package installer * feat(deps): support package cache root
This commit is contained in:
@@ -73,6 +73,24 @@ def clear_temp():
|
||||
SystemUtils.clear(settings.TEMP_PATH, days=settings.TEMP_FILE_DAYS)
|
||||
# 清理图片缓存目录中7天前的文件
|
||||
SystemUtils.clear(settings.CACHE_PATH / "images", days=settings.GLOBAL_IMAGE_CACHE_DAYS)
|
||||
# 清理 pip/uv 包下载缓存,不接管整个 .cache 目录。
|
||||
clear_package_tool_cache()
|
||||
|
||||
|
||||
def clear_package_tool_cache():
|
||||
"""
|
||||
清理 pip/uv 包下载缓存,只处理 MoviePilot 管理的工具子目录。
|
||||
"""
|
||||
days = settings.PACKAGE_CACHE_DAYS
|
||||
if days <= 0:
|
||||
return
|
||||
tool_cache_root = settings.PACKAGE_CACHE_PATH
|
||||
for child in ("pip", "uv"):
|
||||
cache_path = tool_cache_root / child
|
||||
try:
|
||||
SystemUtils.clear(cache_path, days=days)
|
||||
except Exception as err:
|
||||
logger.warning("清理包下载缓存失败:%s - %s", cache_path, err)
|
||||
|
||||
|
||||
def user_auth():
|
||||
|
||||
Reference in New Issue
Block a user