mirror of
https://github.com/misskey-dev/misskey
synced 2024-12-25 03:58:27 +09:00
987168b863
* wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip
21 lines
375 B
TypeScript
21 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');
|
|
}
|
|
}
|