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