judge: pass 'this' param to download (strict mode)

This commit is contained in:
undefined committed 2021-08-03 13:06:11 +08:00
1 parent d0592eac5b
commit 7006457001
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"name": "@hydrooj/hydrojudge", "name": "@hydrooj/hydrojudge",
"bin": "bin/hydrojudge.js", "bin": "bin/hydrojudge.js",
"version": "2.9.4", "version": "2.9.5",
"main": "package.json", "main": "package.json",
"author": "undefined <i@undefined.moe>", "author": "undefined <i@undefined.moe>",
"repository": "https://github.com/hydro-dev/Hydro.git", "repository": "https://github.com/hydro-dev/Hydro.git",
+1 -1
View File
@@ -233,7 +233,7 @@ export default class Hydro {
const tasks = []; const tasks = [];
const queue = new PQueue({ concurrency: 10 }); const queue = new PQueue({ concurrency: 10 });
for (const name in res.data.links) { for (const name in res.data.links) {
tasks.push(queue.add(() => download(name))); tasks.push(queue.add(() => download.call(this, name)));
} }
queue.start(); queue.start();
await Promise.all(tasks); await Promise.all(tasks);