mirror of
https://iceshrimp.dev/crimekillz/trashposs
synced 2024-11-24 01:39:06 +01:00
14148f6c4a
Resolve #7779
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');
|
|
}
|
|
}
|