Relaunch once with an effective libuv threadpool; release 2.1.72
CI / verify (push) Canceled after 0s
CI / verify (push) Canceled after 0s
Setting UV_THREADPOOL_SIZE in main.js had no effect: Electron initialises libuv before the main script runs, so the uploader kept the default four threads for upload reads, logs and queue saves. Packaged builds now relaunch once at startup with UV_THREADPOOL_SIZE=32 before the single-instance lock. Portable and development runs are unchanged. App info and the startup marker report the effective threadpool size. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
7d3a7fd798
commit
8138415b52
5 files changed
+25
-5
No files matched your search
@@ -0,0 +1,13 @@
|
||||
const DESIRED_THREADPOOL_SIZE = 32;
|
||||
|
||||
function relaunchWithThreadpoolSize(app, env = process.env) {
|
||||
if (!app.isPackaged || env.PORTABLE_EXECUTABLE_DIR || env.PORTABLE_EXECUTABLE_FILE || env.MHU_THREADPOOL_RELAUNCHED) return false;
|
||||
const configured = Number(env.UV_THREADPOOL_SIZE);
|
||||
if (Number.isInteger(configured) && configured >= DESIRED_THREADPOOL_SIZE) return false;
|
||||
env.UV_THREADPOOL_SIZE = String(DESIRED_THREADPOOL_SIZE);
|
||||
env.MHU_THREADPOOL_RELAUNCHED = '1';
|
||||
app.relaunch();
|
||||
return true;
|
||||
}
|
||||
|
||||
module.exports = { DESIRED_THREADPOOL_SIZE, relaunchWithThreadpoolSize };
|
||||
Reference in new issue
Block a user