mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 11:20:45 +00:00
23 lines
572 B
TypeScript
23 lines
572 B
TypeScript
import cluster from "cluster";
|
|
import { startMaster } from "./Master";
|
|
import { startWorker } from "./Worker";
|
|
|
|
// Main entry point of the application
|
|
async function main() {
|
|
// Check if this is the primary (master) process
|
|
if (cluster.isPrimary) {
|
|
console.log("Starting master process...");
|
|
await startMaster();
|
|
} else {
|
|
// This is a worker process
|
|
console.log("Starting worker process...");
|
|
await startWorker();
|
|
}
|
|
}
|
|
|
|
// Start the application
|
|
main().catch((error) => {
|
|
console.error("Failed to start server:", error);
|
|
process.exit(1);
|
|
});
|