2018-03-30 15:30:30 -04:00
|
|
|
import * as cluster from 'cluster';
|
2022-04-25 18:09:06 +02:00
|
|
|
import {Server} from './server';
|
|
|
|
import {Worker} from './model/threading/Worker';
|
2023-01-13 00:32:58 +01:00
|
|
|
import {ConfigDiagnostics} from './model/diagnostics/ConfigDiagnostics';
|
2017-07-04 10:24:20 +02:00
|
|
|
|
2023-01-13 00:32:58 +01:00
|
|
|
|
|
|
|
if ((process.argv || []).includes('--run-diagnostics')) {
|
|
|
|
console.log('Running diagnostics and exiting.');
|
|
|
|
ConfigDiagnostics.runDiagnostics().catch((e) => {
|
|
|
|
console.error(e);
|
|
|
|
process.exit(1);
|
|
|
|
}).then(() => {
|
|
|
|
process.exit(0);
|
|
|
|
});
|
2017-07-04 10:24:20 +02:00
|
|
|
} else {
|
2023-01-13 00:32:58 +01:00
|
|
|
if ((cluster as any).isMaster) {
|
|
|
|
new Server();
|
|
|
|
} else {
|
|
|
|
Worker.process();
|
|
|
|
}
|
2017-07-04 10:24:20 +02:00
|
|
|
}
|