mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
judge: bug fixes
This commit is contained in:
3 files changed
+18
-12
No files matched your search
@@ -65,6 +65,10 @@ export default class Hydro implements Session {
|
||||
});
|
||||
if (!res.body.links) throw new FormatError('problem not exist');
|
||||
const queue = new PQueue({ concurrency: 10 });
|
||||
let error = null;
|
||||
queue.on('error', (e) => {
|
||||
error = e;
|
||||
});
|
||||
for (const name in res.body.links) {
|
||||
queue.add(async () => {
|
||||
if (name.includes('/')) await fs.ensureDir(path.dirname(files[name]));
|
||||
@@ -73,6 +77,7 @@ export default class Hydro implements Session {
|
||||
});
|
||||
}
|
||||
await queue.onIdle();
|
||||
if (error) throw error;
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user