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:
|
||||
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:
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user