aboutsummaryrefslogtreecommitdiff
path: root/src/server/index.ts
diff options
context:
space:
mode:
authorSam Wilkins <samwilkins333@gmail.com>2020-01-04 11:12:45 -0800
committerSam Wilkins <samwilkins333@gmail.com>2020-01-04 11:12:45 -0800
commit19b62446a1f05048c6fa940ea4cd7a94021d4ab1 (patch)
tree629f8eefd3af2f9c4bf51fcf4749452f32150ecb /src/server/index.ts
parent9a3df8031b55a16ad55cef6975ff8bf4f681f14e (diff)
cleaner refactor, improved use of configuration
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