尝试清理/tmp

This commit is contained in:
2025-11-10 04:26:26 +00:00
parent 6f9fd8e65e
commit f0b337b222

View File

@@ -458,7 +458,17 @@ get_uris(){
msg "Failed to create tmp dir" "warning" msg "Failed to create tmp dir" "warning"
msg "无法创建临时目录" "warning" msg "无法创建临时目录" "warning"
exit 1 exit 1
} }
cleanup_tmpdir() {
if [ -n "$tmpdir" ] && [ -d "$tmpdir" ]; then
rm -rf "$tmpdir"
fi
}
trap cleanup_tmpdir EXIT
## --print-uris format is: ## --print-uris format is:
# 'fileurl' filename filesize checksum_hint:filechecksum # 'fileurl' filename filesize checksum_hint:filechecksum
# 修改process_package函数增加第二个参数表示当前线程的临时输出文件 # 修改process_package函数增加第二个参数表示当前线程的临时输出文件
@@ -580,6 +590,9 @@ get_uris(){
rm -f "$thread_file" rm -f "$thread_file"
fi fi
done done
# 清理临时目录
cleanup_tmpdir
trap - EXIT # 移除临时目录的陷阱
# 合并显示信息 # 合并显示信息
if [ -f "$tmpdir/display" ]; then if [ -f "$tmpdir/display" ]; then