summary refs log tree commit diff
path: root/src/start.ts
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-08-25 12:55:42 +1000
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-08-25 13:00:31 +1000
commitd946547a9233d866e793e1c68f11d98cb2f7d390 (patch)
tree2ff2677432e2e874f0784b115202f3846e68deb0 /src/start.ts
parentMerge remote-tracking branch 'upstream/staging' into fix/categoryNames (diff)
parentMerge pull request #799 from MaddyUnderStars/feat/captchaVerify (diff)
downloadserver-d946547a9233d866e793e1c68f11d98cb2f7d390.tar.xz
Merge remote-tracking branch 'upstream/staging' into fix/categoryNames
Also allow voice to skip checks
Diffstat (limited to 'src/start.ts')
-rw-r--r--src/start.ts30
1 files changed, 8 insertions, 22 deletions
diff --git a/src/start.ts b/src/start.ts

index a20581c3..cf1a42a5 100644 --- a/src/start.ts +++ b/src/start.ts
@@ -1,19 +1,19 @@ // process.env.MONGOMS_DEBUG = "true"; -import "reflect-metadata"; +import { execSync } from "child_process"; import cluster, { Worker } from "cluster"; +import { config } from "dotenv"; import os from "os"; -import { red, bold, yellow, cyan } from "picocolors"; +import { bold, cyan, red, yellow } from "picocolors"; +import "reflect-metadata"; import { initStats } from "./stats"; -import { config } from "dotenv"; config(); -import { execSync } from "child_process"; // TODO: add socket event transmission let cores = 1; try { cores = Number(process.env.THREADS) || os.cpus().length; } catch { - console.log("[API] Failed to get thread count! Using 1...") + console.log("[API] Failed to get thread count! Using 1..."); } if (cluster.isMaster) { @@ -35,19 +35,9 @@ if (cluster.isMaster) { ██║ ╚██████╔╝███████║███████║╚██████╗╚██████╔╝██║ ██║██████╔╝ ╚═╝ ╚═════╝ ╚══════╝╚══════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚═════╝ - fosscord-server | ${yellow( - `Pre-release (${ - commit !== null - ? commit.slice(0, 7) - : "Unknown (Git cannot be found)" - })` - )} + fosscord-server | ${yellow(`Pre-release (${commit !== null ? commit.slice(0, 7) : "Unknown (Git cannot be found)"})`)} -Commit Hash: ${ - commit !== null - ? `${cyan(commit)} (${yellow(commit.slice(0, 7))})` - : "Unknown (Git cannot be found)" - } +Commit Hash: ${commit !== null ? `${cyan(commit)} (${yellow(commit.slice(0, 7))})` : "Unknown (Git cannot be found)"} Cores: ${cyan(os.cpus().length)} (Using ${cores} thread(s).) `) ); @@ -84,11 +74,7 @@ Cores: ${cyan(os.cpus().length)} (Using ${cores} thread(s).) }); cluster.on("exit", (worker: any, code: any, signal: any) => { - console.log( - `[Worker] ${red( - `died with PID: ${worker.process.pid} , restarting ...` - )}` - ); + console.log(`[Worker] ${red(`died with PID: ${worker.process.pid} , restarting ...`)}`); cluster.fork(); }); }