mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: submissionPriority: ignore rejudged problems
This commit is contained in:
1 parent
c370541268
commit
dd2f595e49
3 files changed
+4
-4
No files matched your search
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hydrooj",
|
"name": "hydrooj",
|
||||||
"version": "3.11.2",
|
"version": "3.11.3",
|
||||||
"bin": "bin/hydrooj.js",
|
"bin": "bin/hydrooj.js",
|
||||||
"main": "src/loader",
|
"main": "src/loader",
|
||||||
"module": "src/loader",
|
"module": "src/loader",
|
||||||
|
|||||||
@@ -27,9 +27,9 @@ class RecordModel {
|
|||||||
];
|
];
|
||||||
|
|
||||||
static async submissionPriority(uid: number, base: number = 0) {
|
static async submissionPriority(uid: number, base: number = 0) {
|
||||||
const pending = await task.count({ uid });
|
const pending = await task.count({ uid, rejudged: { $ne: true } });
|
||||||
const timeRecent = await RecordModel.coll
|
const timeRecent = await RecordModel.coll
|
||||||
.find({ _id: { $gte: Time.getObjectID(moment().add(-1, 'hour')) }, uid }).project({ time: 1 }).toArray();
|
.find({ _id: { $gte: Time.getObjectID(moment().add(-30, 'minutes')) }, uid }).project({ time: 1 }).toArray();
|
||||||
return base - ((pending * 1000 + 1) * (sum(timeRecent.map((i) => i.time || 0)) / 10000));
|
return base - ((pending * 1000 + 1) * (sum(timeRecent.map((i) => i.time || 0)) / 10000));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -415,7 +415,7 @@ export class Handler extends HandlerCommon {
|
|||||||
headers: any,
|
headers: any,
|
||||||
cookies: any,
|
cookies: any,
|
||||||
body: any,
|
body: any,
|
||||||
files: any,
|
files: Record<string, import('formidable').File>,
|
||||||
query: any,
|
query: any,
|
||||||
path: string,
|
path: string,
|
||||||
params: any,
|
params: any,
|
||||||
|
|||||||
Reference in new issue
Block a user