Merge pull request #2355 from InfinityPacer/main

This commit is contained in:
jxxghp
2024-06-17 21:09:00 +08:00
committed by GitHub
2 changed files with 7 additions and 18 deletions

View File

@ -10,6 +10,7 @@ from typing import List, Union, Tuple
import docker
import psutil
from app import schemas
@ -469,7 +470,9 @@ class SystemUtils:
@staticmethod
def is_hardlink(src: Path, dest: Path) -> bool:
"""判断是否为硬链接"""
"""
判断是否为硬链接可能无法支持宿主机挂载smb盘符映射docker的场景
"""
try:
if not src.exists() or not dest.exists():
return False
@ -487,7 +490,7 @@ class SystemUtils:
if not target_file.exists() or not src_file.samefile(target_file):
return False
return True
except (PermissionError, FileNotFoundError, ValueError, OSError) as e:
except Exception as e:
print(f"Error occurred: {e}")
return False