mirror of
https://github.com/xuthus83/pigallery2.git
synced 2025-01-14 14:43:17 +08:00
22 lines
543 B
TypeScript
22 lines
543 B
TypeScript
import * as cluster from 'cluster';
|
|
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();
|
|
}
|
|
}
|