summary refs log tree commit diff
path: root/src/start.ts
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-05-27 18:15:33 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-05-27 18:15:33 +0200
commitb00815b025575bfe79f6f5d2d4004b8da9b9b946 (patch)
tree1d86d7767ba8f29396421ca0ed37afb892214252 /src/start.ts
parent:bug: fix bans (diff)
parent:arrow_up: npm i @fosscord/server-util@1.3.5 (diff)
downloadserver-b00815b025575bfe79f6f5d2d4004b8da9b9b946.tar.xz
Merge branch 'master' of https://github.com/fosscord/fosscord-api
Diffstat (limited to 'src/start.ts')
-rw-r--r--src/start.ts7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/start.ts b/src/start.ts

index 8d5c33ce..d799c190 100644 --- a/src/start.ts +++ b/src/start.ts
@@ -7,9 +7,9 @@ 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") { +if (cluster.isMaster && process.env.NODE_ENV == "production") { console.log(`Primary ${process.pid} is running`); // Fork workers. @@ -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);