Skip to content

fix: avoid falling back to copy files when moving files in docker #237

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dahai9
Copy link
Contributor

@dahai9 dahai9 commented Mar 31, 2025

shutil.move() 函数是 Python shutil 模块中用于移动文件或目录的函数。理想情况下,它会执行一个重命名操作,这个操作非常快,因为它只需要更新元数据(比如文件名和文件在文件系统目录结构中的位置),而不需要实际复制数据。

Docker 容器中的路径 ./download:/app/download 和 ./temp:/app/temp 会被 shutil.move() 判定为位于不同的文件系统,即使它们看起来都在 /download 目录下.

dahai9 added 2 commits March 31, 2025 20:47
In Docker, due to temp and download no longer being in the same volume, moving files results in a fallback to copying and then deleting the temp_save file
this will cause moving file back to copy files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant