mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
markdown preview
This commit is contained in:
1 parent
86f67a0ec3
commit
5ca424da0b
15 files changed
+123
-104
No files matched your search
@@ -28,12 +28,16 @@ async function _parseDagJson(domainId, dag) {
|
||||
for (const nid of node.requireNids) {
|
||||
assert(ids.has(nid), `required nid ${nid} not found`);
|
||||
}
|
||||
const tasks = [];
|
||||
for (const i in node.pids) {
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
const pdoc = await problem.get(domainId, node.pids[i]); // FIXME no-await-in-loop
|
||||
assert(pdoc, `Problem not found: ${node.pids[i]}`);
|
||||
node.pids[i] = pdoc.docId;
|
||||
tasks.push(problem.get(domainId, node.pids[i]).then((pdoc) => {
|
||||
if (!pdoc) throw new ProblemNotFoundError(domainId, node.pids[i]);
|
||||
node.pids[i] = pdoc.docId;
|
||||
}));
|
||||
}
|
||||
// FIXME no-await-in-loop
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
await Promise.all(tasks);
|
||||
const newNode = {
|
||||
_id: parseInt(node._id),
|
||||
title: node.title,
|
||||
|
||||
Reference in new issue
Block a user