From 9ddd13a5e943e3301fe25a612efcb0bac8127b07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Minelli?= <michael@minelli.me> Date: Wed, 6 Mar 2024 13:27:13 +0100 Subject: [PATCH] Multiprocess => Do not run multiprocess in dev env. --- ExpressAPI/src/app.ts | 17 +++++++++++------ ExpressAPI/src/shared | 2 +- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/ExpressAPI/src/app.ts b/ExpressAPI/src/app.ts index 487035a..b1eb7d2 100644 --- a/ExpressAPI/src/app.ts +++ b/ExpressAPI/src/app.ts @@ -1,5 +1,6 @@ require('./InitialImports'); // ATTENTION : These lines MUST be the first of this file +import SharedConfig from './shared/config/SharedConfig'; import WorkerRole from './process/WorkerRole'; import ClusterManager from './process/ClusterManager'; import API from './express/API'; @@ -9,9 +10,13 @@ import HttpManager from './managers/HttpManager'; HttpManager.registerAxiosInterceptor(); -(new ClusterManager([ { - role : WorkerRole.API, - quantity : ClusterManager.CORES, - restartOnFail: true, - loadTask : () => new API() -} ])).run(); +if ( SharedConfig.production ) { + (new ClusterManager([ { + role : WorkerRole.API, + quantity : ClusterManager.CORES, + restartOnFail: true, + loadTask : () => new API() + } ])).run(); +} else { + (new API()).run(); +} diff --git a/ExpressAPI/src/shared b/ExpressAPI/src/shared index 75fedb2..985c0b6 160000 --- a/ExpressAPI/src/shared +++ b/ExpressAPI/src/shared @@ -1 +1 @@ -Subproject commit 75fedb26c47bb6f707725307a79a45a13e62496d +Subproject commit 985c0b6a5dcb640404e5cf5fc91978215f961e3b -- GitLab