From 74c69c698e347e655ee871d6670c9bbac4ca1b75 Mon Sep 17 00:00:00 2001 From: DebaucheryLibrarian Date: Tue, 27 Jan 2026 01:04:28 +0100 Subject: [PATCH] PM2 ecosystem file calls src/app directly, should fix cluster problem. --- ecosystem.config.cjs | 5 +++-- src/web/server.js | 6 ++++-- static | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/ecosystem.config.cjs b/ecosystem.config.cjs index 846f10d..c1112ce 100644 --- a/ecosystem.config.cjs +++ b/ecosystem.config.cjs @@ -4,8 +4,9 @@ module.exports = { apps: [ { name: 'traxxx', - script: 'npm', - args: 'run server:prod', + // script: 'npm', + // args: 'run server:prod', + script: './src/app.js', exec_mode: 'cluster', instances: 2, restart_delay: 3000, diff --git a/src/web/server.js b/src/web/server.js index 67193b8..075f5eb 100644 --- a/src/web/server.js +++ b/src/web/server.js @@ -175,7 +175,9 @@ export default async function initServer() { app.use(router); const port = process.env.PORT || config.web.port || 3000; - app.listen(port); + // const port = Math.round(Math.random() * 10000); - logger.info(`Server running at http://localhost:${port}`); + app.listen(port, config.web.host); + + logger.info(`Server running at http://${config.web.host}:${port}`); } diff --git a/static b/static index 1c4d379..2af6f58 160000 --- a/static +++ b/static @@ -1 +1 @@ -Subproject commit 1c4d379e1ecab3888a97bc353ee236fbc7834fbb +Subproject commit 2af6f58ca1cd9421515ad0d0ffd5adb1c781adeb