fix:清理images文件夹

This commit is contained in:
SengokuCola
2025-06-25 18:42:30 +08:00
parent 7e3e1bf30f
commit 2a06070ba9
2 changed files with 4 additions and 4 deletions

View File

@@ -303,16 +303,16 @@ def _ensure_emoji_dir() -> None:
async def clear_temp_emoji() -> None:
"""清理临时表情包
清理/data/emoji和/data/image目录下的所有文件
清理/data/emoji、/data/image和/data/images目录下的所有文件
当目录中文件数超过100时会全部删除
"""
logger.info("[清理] 开始清理缓存...")
for need_clear in (os.path.join(BASE_DIR, "emoji"), os.path.join(BASE_DIR, "image")):
for need_clear in (os.path.join(BASE_DIR, "emoji"), os.path.join(BASE_DIR, "image"), os.path.join(BASE_DIR, "images")):
if os.path.exists(need_clear):
files = os.listdir(need_clear)
# 如果文件数超过50就全部删除
# 如果文件数超过100就全部删除
if len(files) > 100:
for filename in files:
file_path = os.path.join(need_clear, filename)

View File

@@ -50,7 +50,7 @@ TEMPLATE_DIR = os.path.join(PROJECT_ROOT, "template")
# 考虑到实际上配置文件中的mai_version是不会自动更新的,所以采用硬编码
# 对该字段的更新请严格参照语义化版本规范https://semver.org/lang/zh-CN/
MMC_VERSION = "0.8.0-snapshot.3"
MMC_VERSION = "0.8.0"
def update_config():