misskey/src/boot/worker.ts
syuilo 987168b863
strictNullChecks (#4666)
* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip
2019-04-13 01:43:22 +09:00

20 lines
375 B
TypeScript

import * as cluster from 'cluster';
import { initDb } from '../db/postgre';
/**
* Init worker process
*/
export async function workerMain() {
await initDb();
// start server
await require('../server').default();
// start job queue
require('../queue').default();
if (cluster.isWorker) {
// Send a 'ready' message to parent process
process.send!('ready');
}
}