mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
vjudge: prevent race
This commit is contained in:
1 parent
3027421101
commit
dfe60b5890
2 files changed
+2
-2
No files matched your search
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@hydrooj/vjudge",
|
||||
"version": "1.2.2",
|
||||
"version": "1.2.3",
|
||||
"description": "Submit problems to remote oj",
|
||||
"main": "package.json",
|
||||
"repository": "https://github.com/hydro-dev/Hydro.git",
|
||||
|
||||
@@ -42,7 +42,7 @@ class Service {
|
||||
while (pids.length) {
|
||||
logger.info(`${domainId}: Syncing page ${page}`);
|
||||
for (const pid of pids) {
|
||||
if (syncing[`${domainId}/${pid}`] || await ProblemModel.get(domainId, pid)) continue;
|
||||
if (await ProblemModel.get(domainId, pid) || syncing[`${domainId}/${pid}`]) continue;
|
||||
syncing[`${domainId}/${pid}`] = true;
|
||||
try {
|
||||
const res = await this.api.getProblem(pid);
|
||||
|
||||
Reference in new issue
Block a user