mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
core: pm2 cluster management
This commit is contained in:
1 parent
9f5c00a985
commit
448c398d21
30 files changed
+206
-427
No files matched your search
@@ -151,11 +151,11 @@ class JudgeConnectionHandler extends ConnectionHandler {
|
||||
if (this.processing) return;
|
||||
let t;
|
||||
while (!t) {
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
await sleep(100);
|
||||
if (this.closed) return;
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
t = await task.getFirst(this.query);
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
if (!t) await sleep(500);
|
||||
}
|
||||
this.send({ task: t });
|
||||
this.processing = t;
|
||||
|
||||
@@ -89,8 +89,7 @@ class SystemDashboardHandler extends SystemHandler {
|
||||
}
|
||||
|
||||
async postRestart() {
|
||||
const count = system.get('server.worker');
|
||||
process.send({ event: 'restart', payload: [count] });
|
||||
// TODO handle restart
|
||||
this.back();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user