aboutsummaryrefslogtreecommitdiff
path: root/src/server/index.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/index.ts')
-rw-r--r--src/server/index.ts11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/server/index.ts b/src/server/index.ts
index 381496c20..0a5b4afae 100644
--- a/src/server/index.ts
+++ b/src/server/index.ts
@@ -24,6 +24,13 @@ import GooglePhotosManager from "./ApiManagers/GooglePhotosManager";
import { Logger } from "./ProcessFactory";
import { yellow } from "colors";
import { Session } from "./Session/session";
+import { isMaster } from "cluster";
+
+if (isMaster) {
+ Session.initializeMaster();
+} else {
+ Session.initializeWorker(launch);
+}
export const publicDirectory = path.resolve(__dirname, "public");
export const filesDirectory = path.resolve(publicDirectory, "files");
@@ -133,6 +140,4 @@ async function launch() {
action: preliminaryFunctions
});
await initializeServer({ serverPort: 1050, routeSetter });
-}
-
-Session.initialize(launch); \ No newline at end of file
+} \ No newline at end of file