mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
core: 修复hydrooj addon运行完成后不会自行退出的问题
This commit is contained in:
1 parent
3f78c35359
commit
f9aef434cb
4 files changed
+24
-8
No files matched your search
@@ -5,9 +5,9 @@ const path = require('path');
|
||||
const cluster = require('cluster');
|
||||
const fs = require('fs-extra');
|
||||
const { argv } = require('yargs');
|
||||
const hydro = require('../dist/loader');
|
||||
|
||||
if (!cluster.isMaster) {
|
||||
const hydro = require('../dist/loader');
|
||||
// Forked by hydro
|
||||
hydro.load().catch((e) => {
|
||||
console.error(e);
|
||||
@@ -46,6 +46,7 @@ if (!cluster.isMaster) {
|
||||
fs.writeFileSync(addonPath, JSON.stringify(addons, null, 2));
|
||||
}
|
||||
} else {
|
||||
const hydro = require('../dist/loader');
|
||||
addons = Array.from(new Set(addons));
|
||||
for (const addon of addons) hydro.addon(addon);
|
||||
(argv._[0] === 'cli' ? hydro.loadCli : hydro.load)().catch((e) => {
|
||||
|
||||
Reference in new issue
Block a user