mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: fix cross-machine broadcast
This commit is contained in:
1 parent
3adde783a3
commit
7f21848174
2 files changed
+4
-2
No files matched your search
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hydrooj",
|
"name": "hydrooj",
|
||||||
"version": "2.37.0",
|
"version": "2.37.1",
|
||||||
"bin": "bin/hydrooj.js",
|
"bin": "bin/hydrooj.js",
|
||||||
"main": "src/loader",
|
"main": "src/loader",
|
||||||
"module": "src/loader",
|
"module": "src/loader",
|
||||||
|
|||||||
@@ -160,7 +160,9 @@ bus.once('app/started', async () => {
|
|||||||
{ ack: { $not: { $elemMatch: { $eq: id } } } },
|
{ ack: { $not: { $elemMatch: { $eq: id } } } },
|
||||||
{ $push: { ack: id } },
|
{ $push: { ack: id } },
|
||||||
);
|
);
|
||||||
if (res.value) bus.parallel(res.value.event, ...JSON.parse(res.value.payload));
|
const payload = JSON.parse(res.value.payload);
|
||||||
|
if (process.send) process.send({ type: 'hydro:broadcast', data: { event: res.value.event, payload } });
|
||||||
|
if (res.value) bus.parallel(res.value.event, ...payload);
|
||||||
// eslint-disable-next-line no-await-in-loop
|
// eslint-disable-next-line no-await-in-loop
|
||||||
else await sleep(100);
|
else await sleep(100);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user