From 6f51eaa29856d3d21d4cdc0a4fa5dd63067e089d Mon Sep 17 00:00:00 2001 From: dami Date: Mon, 6 Jul 2026 20:59:32 +0800 Subject: [PATCH] update --- plugins/webstats/tool_migrate.py | 2 +- web/core/mw.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/webstats/tool_migrate.py b/plugins/webstats/tool_migrate.py index ec58c453f..60d24506b 100644 --- a/plugins/webstats/tool_migrate.py +++ b/plugins/webstats/tool_migrate.py @@ -117,7 +117,7 @@ def migrateSiteHotLogs(site_name, query_date): copy_start = time.time() # import shutil # shutil.copy(hot_db, hot_db_tmp) - mw.fastCopy(hot_db, hot_db_tmp, 512 * 1024 * 1024) + mw.fastCopy(hot_db, hot_db_tmp, 256 * 1024) print(f"[{site_name}] 备份完成,耗时 {time.time() - copy_start:.2f}s") if not os.path.exists(hot_db_tmp): return mw.returnMsg(False, f"{site_name} migrating fail, copy tmp file!") diff --git a/web/core/mw.py b/web/core/mw.py index 5a0315aac..e6100a285 100644 --- a/web/core/mw.py +++ b/web/core/mw.py @@ -319,7 +319,7 @@ def toSize(size, middle='') -> str: s = u return str(round(size, 2)) + middle + u -def fastCopy(src, dst, buffer_size=128 * 1024 * 1024): # 128MB 缓冲区 +def fastCopy(src, dst, buffer_size=256 * 1024): # 128MB 缓冲区 with open(src, 'rb') as fsrc: with open(dst, 'wb') as fdst: shutil.copyfileobj(fsrc, fdst, length=buffer_size)