mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
fix rejudge, add cache
This commit is contained in:
1 parent
c68953c59f
commit
4c53fc8146
7 files changed
+103
-103
No files matched your search
+15
-1
@@ -45,6 +45,19 @@ async function update(rid, $set) {
|
||||
if (!rdoc) throw new RecordNotFoundError(rid);
|
||||
return rdoc;
|
||||
}
|
||||
async function reset(rid) {
|
||||
return await update(rid, {
|
||||
score: 0,
|
||||
status: STATUS_WAITING,
|
||||
time: 0,
|
||||
memory: 0,
|
||||
cases: [],
|
||||
judgeTexts: [],
|
||||
compilerTexts: [],
|
||||
judgeAt: null,
|
||||
judger: null
|
||||
});
|
||||
}
|
||||
async function count(query) {
|
||||
return await coll.find(query).count();
|
||||
}
|
||||
@@ -54,5 +67,6 @@ module.exports = {
|
||||
get,
|
||||
getMany,
|
||||
update,
|
||||
count
|
||||
count,
|
||||
reset
|
||||
};
|
||||
Reference in new issue
Block a user