mirror of
https://iceshrimp.dev/crimekillz/iceshrimp-161sh.git
synced 2024-11-23 20:49:06 +01:00
94228778c9
* wip * wip * fix * clean up * Update tsconfig.json * Update activitypub.ts * wip
21 lines
420 B
TypeScript
21 lines
420 B
TypeScript
import cluster from 'node:cluster';
|
|
import { initDb } from '../db/postgre.js';
|
|
|
|
/**
|
|
* Init worker process
|
|
*/
|
|
export async function workerMain() {
|
|
await initDb();
|
|
|
|
// start server
|
|
await import('../server/index.js').then(x => x.default());
|
|
|
|
// start job queue
|
|
import('../queue/index.js').then(x => x.default());
|
|
|
|
if (cluster.isWorker) {
|
|
// Send a 'ready' message to parent process
|
|
process.send!('ready');
|
|
}
|
|
}
|