Enhance file handling in LoraScanner and file_utils: resolve symlinks and improve error logging

This commit is contained in:
Will Miao
2025-02-22 11:31:00 +08:00
parent ba2c80496e
commit af5c2341e7
2 changed files with 37 additions and 21 deletions

View File

@@ -294,7 +294,7 @@ class LoraScanner:
async def scan_single_lora(self, file_path: str) -> Optional[Dict]:
"""Scan a single LoRA file and return its metadata"""
try:
if not os.path.exists(file_path):
if not os.path.exists(os.path.realpath(file_path)):
return None
# 获取基本文件信息