problem pretest

This commit is contained in:
undefined committed 2020-06-28 13:05:40 +08:00
1 parent dd5a212422
commit 554698189c
17 files changed
+127 -57

No files matched your search

+9 -1
View File
@@ -59,7 +59,15 @@ async function executeCommand(input) {
async function messageHandler(worker, msg) {
if (!msg) msg = worker;
if (msg.event) {
if (msg.event === 'stat') {
if (msg.event === 'bus') {
if (cluster.isMaster) {
for (const i in cluster.workers) {
if (i !== worker.id) cluster.workers[i].send(msg);
}
} else {
global.Hydro.service.bus.publish(msg.eventName, msg.payload, false);
}
} else if (msg.event === 'stat') {
global.Hydro.stat.reqCount += msg.count;
} else if (msg.event === 'restart') {
console.log('Restarting');