mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +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
@@ -9,6 +9,7 @@ import path from 'path';
|
||||
import cluster from 'cluster';
|
||||
import fs from 'fs-extra';
|
||||
import { argv } from 'yargs';
|
||||
import wtfnode from 'wtfnode';
|
||||
import './utils';
|
||||
|
||||
export * from './interface';
|
||||
@@ -47,6 +48,14 @@ import * as bus from './service/bus';
|
||||
|
||||
const logger = new Logger('loader');
|
||||
logger.debug('%o', argv);
|
||||
bus.on('app/exit', () => {
|
||||
if (argv.debug) {
|
||||
wtfnode.setLogger('info', logger.info.bind(logger));
|
||||
wtfnode.setLogger('warn', logger.warn.bind(logger));
|
||||
wtfnode.setLogger('error', logger.error.bind(logger));
|
||||
wtfnode.dump();
|
||||
}
|
||||
});
|
||||
|
||||
async function fork(args: string[] = []) {
|
||||
const _args = process.argv.slice(2);
|
||||
|
||||
Reference in new issue
Block a user