perf(scan): timeout/module 30s->12s (Ozone treo vinh vien), subprocess 600->180s

This commit is contained in:
2026-08-22 02:05:49 +00:00
parent 67245a6f61
commit eecc4501bc
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -512,7 +512,7 @@ class PluginManager:
for d in dirs:
try:
r = subprocess.run([exe, "--scan", d], capture_output=True,
text=True, timeout=600)
text=True, timeout=180)
except Exception:
continue
if r.returncode != 0:
+2 -2
View File
@@ -1506,12 +1506,12 @@ bool safeScanModule(const std::string& path, std::vector<ScanEntry>& out) {
ScanCtx ctx{&path, &out};
HANDLE hThread = CreateThread(nullptr, 0, scanWorker, &ctx, 0, nullptr);
if (!hThread) { std::cerr << "[Scan] skip (thread fail): " << path << std::endl; return false; }
const DWORD timeoutMs = 30000; // 30s/module — generous for big VST3s
const DWORD timeoutMs = 12000; // 12s/module — Ozone treo vĩnh viễn, đủ phân biệt
DWORD wait = WaitForSingleObject(hThread, timeoutMs);
if (wait == WAIT_TIMEOUT) {
TerminateThread(hThread, 0);
CloseHandle(hThread);
std::cerr << "[Scan] skip (timeout 30s): " << path << std::endl;
std::cerr << "[Scan] skip (timeout 12s): " << path << std::endl;
return false;
}
CloseHandle(hThread);