1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2025-01-14 14:43:17 +08:00

22 lines
543 B
TypeScript
Raw Normal View History

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';
import {ConfigDiagnostics} from './model/diagnostics/ConfigDiagnostics';
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);
});
} else {
if ((cluster as any).isMaster) {
new Server();
} else {
Worker.process();
}
}