fix:清理images文件夹
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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():
|
||||
|
||||
Reference in New Issue
Block a user