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