core: 修复hydrooj addon运行完成后不会自行退出的问题

This commit is contained in:
undefined committed 2021-02-22 00:41:00 +08:00
1 parent 3f78c35359
commit f9aef434cb
4 files changed
+24 -8

No files matched your search

+9
View File
@@ -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);