core: pm2 cluster management

This commit is contained in:
undefined committed 2021-09-09 06:18:16 +08:00
1 parent 9f5c00a985
commit 448c398d21
30 files changed
+206 -427

No files matched your search

-2
View File
@@ -1,4 +1,3 @@
import cluster from 'cluster';
import 'hydrooj/src/loader';
import * as bus from 'hydrooj/src/service/bus';
@@ -23,5 +22,4 @@ export async function dispose() {
const db = require('hydrooj/src/service/db');
await db.stop();
bus.emit('app/exit');
for (const key in cluster.workers) cluster.workers[key].destroy('SIGINT');
}