judge: fix lock aquire

This commit is contained in:
undefined committed 2021-08-23 03:49:04 +08:00
1 parent 72053d7a37
commit 95be2f95a5
2 files changed
+3 -2

No files matched your search

+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@hydrooj/hydrojudge",
"bin": "bin/hydrojudge.js",
"version": "2.10.14",
"version": "2.10.15",
"main": "package.json",
"author": "undefined <i@undefined.moe>",
"repository": "https://github.com/hydro-dev/Hydro.git",
+2 -1
View File
@@ -57,7 +57,8 @@ export namespace Lock {
const data = {};
export async function aquire(key: string) {
while (data[key]) sleep(100);
// eslint-disable-next-line no-await-in-loop
while (data[key]) await sleep(100);
data[key] = true;
}