mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
更改updateStatus逻辑,导入problem.status
This commit is contained in:
1 parent
4c3284c917
commit
d04628148f
6 files changed
+103
-105
No files matched your search
@@ -19,14 +19,12 @@ async function _postJudge(rdoc) {
|
||||
contest.updateStatus(rdoc.tid, rdoc.uid, rdoc._id, rdoc.pid, accept, rdoc.score),
|
||||
);
|
||||
}
|
||||
if (!rdoc.rejudged) {
|
||||
if (await problem.updateStatus(rdoc.pid, rdoc.uid, rdoc._id, rdoc.status)) {
|
||||
if (accept) {
|
||||
tasks.push(
|
||||
problem.inc(rdoc.pid, 'nAccept', 1),
|
||||
user.inc(rdoc.uid, 'nAccept', 1),
|
||||
);
|
||||
}
|
||||
if (await problem.updateStatus(rdoc.pid, rdoc.uid, rdoc._id, rdoc.status)) {
|
||||
if (accept && !rdoc.rejudged) {
|
||||
tasks.push(
|
||||
problem.inc(rdoc.pid, 'nAccept', 1),
|
||||
user.inc(rdoc.uid, 'nAccept', 1),
|
||||
);
|
||||
}
|
||||
}
|
||||
await Promise.all(tasks);
|
||||
|
||||
Reference in new issue
Block a user