diff options
author | TheArcaneBrony <myrainbowdash949@gmail.com> | 2022-04-19 00:57:58 +0200 |
---|---|---|
committer | TheArcaneBrony <myrainbowdash949@gmail.com> | 2022-04-19 00:57:58 +0200 |
commit | 96b3929fa4c0d2cc6613957e6f1636d0f7644527 (patch) | |
tree | 17c82d3bfb8d963f9e2ac5cf5540753efdfd714e /bundle/src | |
parent | general rights enforcement stuff (diff) | |
download | server-96b3929fa4c0d2cc6613957e6f1636d0f7644527.tar.xz |
Use 1 thread on platform where fetching thread/core count fails
Diffstat (limited to 'bundle/src')
-rw-r--r-- | bundle/src/start.ts | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/bundle/src/start.ts b/bundle/src/start.ts index 7660b296..de3b5848 100644 --- a/bundle/src/start.ts +++ b/bundle/src/start.ts @@ -9,7 +9,12 @@ config(); import { execSync } from "child_process"; // TODO: add socket event transmission -let cores = Number(process.env.THREADS) || os.cpus().length; +var cores = 1; +try { + cores = Number(process.env.THREADS) || os.cpus().length; +} catch { + console.log("[API] Failed to get thread count! Using 1...") +} if (cluster.isMaster) { function getCommitOrFail() { |