summary refs log tree commit diff
path: root/bundle/scripts/benchmark/connections.js
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-07-07 23:34:43 +1000
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-07-07 23:34:43 +1000
commit74857223acc0b9ef67c6a5ca437637591a828619 (patch)
tree919124034d3aac958878cfe8101676de9f09064c /bundle/scripts/benchmark/connections.js
parentEnsure password was given if email is given in PATCH @me (diff)
parentFormat changed files (diff)
downloadserver-74857223acc0b9ef67c6a5ca437637591a828619.tar.xz
Merge branch 'master' into fix/claim_accounts
Diffstat (limited to 'bundle/scripts/benchmark/connections.js')
-rw-r--r--bundle/scripts/benchmark/connections.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/bundle/scripts/benchmark/connections.js b/bundle/scripts/benchmark/connections.js

index 2a4125b4..ffca2628 100644 --- a/bundle/scripts/benchmark/connections.js +++ b/bundle/scripts/benchmark/connections.js
@@ -3,8 +3,13 @@ const cluster = require("cluster"); const WebSocket = require("ws"); const endpoint = process.env.GATEWAY || "ws://localhost:3001"; const connections = Number(process.env.CONNECTIONS) || 50; -const threads = Number(process.env.THREADS) || require("os").cpus().length || 1; const token = process.env.TOKEN; +var cores = 1; +try { + cores = Number(process.env.THREADS) || os.cpus().length; +} catch { + console.log("[Bundle] Failed to get thread count! Using 1...") +} if (!token) { console.error("TOKEN env var missing");