perf(scan): timeout/module 30s->12s (Ozone treo vinh vien), subprocess 600->180s
This commit is contained in:
@@ -512,7 +512,7 @@ class PluginManager:
|
|||||||
for d in dirs:
|
for d in dirs:
|
||||||
try:
|
try:
|
||||||
r = subprocess.run([exe, "--scan", d], capture_output=True,
|
r = subprocess.run([exe, "--scan", d], capture_output=True,
|
||||||
text=True, timeout=600)
|
text=True, timeout=180)
|
||||||
except Exception:
|
except Exception:
|
||||||
continue
|
continue
|
||||||
if r.returncode != 0:
|
if r.returncode != 0:
|
||||||
|
|||||||
@@ -1506,12 +1506,12 @@ bool safeScanModule(const std::string& path, std::vector<ScanEntry>& out) {
|
|||||||
ScanCtx ctx{&path, &out};
|
ScanCtx ctx{&path, &out};
|
||||||
HANDLE hThread = CreateThread(nullptr, 0, scanWorker, &ctx, 0, nullptr);
|
HANDLE hThread = CreateThread(nullptr, 0, scanWorker, &ctx, 0, nullptr);
|
||||||
if (!hThread) { std::cerr << "[Scan] skip (thread fail): " << path << std::endl; return false; }
|
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);
|
DWORD wait = WaitForSingleObject(hThread, timeoutMs);
|
||||||
if (wait == WAIT_TIMEOUT) {
|
if (wait == WAIT_TIMEOUT) {
|
||||||
TerminateThread(hThread, 0);
|
TerminateThread(hThread, 0);
|
||||||
CloseHandle(hThread);
|
CloseHandle(hThread);
|
||||||
std::cerr << "[Scan] skip (timeout 30s): " << path << std::endl;
|
std::cerr << "[Scan] skip (timeout 12s): " << path << std::endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
CloseHandle(hThread);
|
CloseHandle(hThread);
|
||||||
|
|||||||
Reference in New Issue
Block a user