mirror of
https://github.com/MisskeyIO/misskey
synced 2024-12-17 16:18:23 +09:00
21 lines
374 B
TypeScript
21 lines
374 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');
|
||
|
}
|
||
|
}
|