mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 17:36:08 +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",
|
||||
"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",
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user