From 8f87546aeb5c14539601ab25c0e07630a5e5043a Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Mon, 24 May 2021 20:47:06 +0200 Subject: :sparkles: use new config --- src/start.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/start.ts') diff --git a/src/start.ts b/src/start.ts index 8d5c33ce..1f069c51 100644 --- a/src/start.ts +++ b/src/start.ts @@ -7,7 +7,7 @@ config(); import { FosscordServer } from "./Server"; import cluster from "cluster"; import os from "os"; -const cores = os.cpus().length; +const cores = Number(process.env.threads) || os.cpus().length; if (cluster.isMaster && process.env.production == "true") { console.log(`Primary ${process.pid} is running`); @@ -22,8 +22,7 @@ if (cluster.isMaster && process.env.production == "true") { cluster.fork(); }); } else { - var port = Number(process.env.PORT); - if (isNaN(port)) port = 3001; + var port = Number(process.env.PORT) || 3001; const server = new FosscordServer({ port }); server.start().catch(console.error); -- cgit 1.5.1