summary refs log tree commit diff
path: root/src/start.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/start.ts')
-rw-r--r--src/start.ts5
1 files changed, 2 insertions, 3 deletions
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);