mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 09:46:28 +08:00
judge: fix lock aquire
This commit is contained in:
1 parent
72053d7a37
commit
95be2f95a5
2 files changed
+3
-2
No files matched your search
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/hydrojudge",
|
"name": "@hydrooj/hydrojudge",
|
||||||
"bin": "bin/hydrojudge.js",
|
"bin": "bin/hydrojudge.js",
|
||||||
"version": "2.10.14",
|
"version": "2.10.15",
|
||||||
"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",
|
||||||
|
|||||||
@@ -57,7 +57,8 @@ export namespace Lock {
|
|||||||
const data = {};
|
const data = {};
|
||||||
|
|
||||||
export async function aquire(key: string) {
|
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;
|
data[key] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user