Skip to content

Commit e91aea8

Browse files
committed
🎨优化zip包解压
1 parent 2ea18f5 commit e91aea8

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

client/node/toolloader/httploadtool.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
from util.logutil import LogPrinter
1515
from util.api.fileserver import RetryFileServer
1616
from util.exceptions import FileServerError
17-
from util.ziplib import ZipMgr
17+
from util.pathlib import PathMgr
18+
from util.zipmgr import Zip
1819

1920

2021
class HttpToolLoader(object):
@@ -37,8 +38,10 @@ def download_tool(tool_url, dest_dir):
3738

3839
if os.path.exists(dest_zip_file_path):
3940
LogPrinter.debug(f"download {tool_url} to {dest_zip_file_path}")
40-
ZipMgr.depress(dest_zip_file_path, tool_root_dir)
41+
# 使用7z解压
42+
Zip().decompress_by_7z(dest_zip_file_path, tool_root_dir)
4143
LogPrinter.debug(f"unzip {dest_zip_file_path} to {dest_dir}")
44+
PathMgr().safe_rmpath(dest_zip_file_path)
4245
else:
4346
raise FileServerError(f"download {tool_url} failed!")
4447

0 commit comments

Comments
 (0)