Github Oauth,支持自动转换config.ini配置

This commit is contained in:
undefined committed 2020-06-21 13:37:55 +08:00
1 parent 5707f973d7
commit 8476eac3b4
17 files changed
+240 -109

No files matched your search

+14 -8
View File
@@ -58,24 +58,30 @@ async function executeCommand(input) {
async function messageHandler(worker, msg) {
if (!msg) msg = worker;
if (msg.event && msg.event === 'restart') {
console.log('Restarting');
await stopWorker();
console.log('Worker stopped');
await startWorker(msg.count);
} else if (msg.event && msg.event === 'run') {
await executeCommand(msg.command);
if (msg.event) {
if (msg.event === 'stat') {
global.Hydro.stat.reqCount += msg.count;
} else if (msg.event === 'restart') {
console.log('Restarting');
await stopWorker();
console.log('Worker stopped');
await startWorker(msg.count);
} else if (msg.event === 'run') {
await executeCommand(msg.command);
}
}
}
async function load() {
global.nodeModules = {
'adm-zip': require('adm-zip'),
axios: require('axios'),
bson: require('bson'),
'js-yaml': require('js-yaml'),
mongodb: require('mongodb'),
};
global.Hydro = {
config: {},
stat: { reqCount: 0 },
handler: {},
service: {},
model: {},