Optimize SystemUtils.move to avoid triggering directory monitoring

Co-authored-by: jxxghp <51039935+jxxghp@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-02-06 14:03:03 +00:00
parent bb4dffe2a4
commit c064c3781f

View File

@@ -166,10 +166,8 @@ class SystemUtils:
移动 移动
""" """
try: try:
# 当前目录改名 # 直接移动到目标路径,避免中间改名步骤触发目录监控
temp = src.replace(src.parent / dest.name) shutil.move(src, dest)
# 移动到目标目录
shutil.move(temp, dest)
return 0, "" return 0, ""
except Exception as err: except Exception as err:
return -1, str(err) return -1, str(err)