core: update priority calculation

pull/370/head
undefined 2 years ago
parent 792f1c6266
commit 00176ddb14

@ -1,6 +1,6 @@
{ {
"name": "hydrooj", "name": "hydrooj",
"version": "3.13.14", "version": "3.13.15",
"bin": "bin/hydrooj.js", "bin": "bin/hydrooj.js",
"main": "src/loader", "main": "src/loader",
"module": "src/loader", "module": "src/loader",

@ -30,7 +30,7 @@ class RecordModel {
const pending = await task.count({ uid, rejudged: { $ne: true } }); 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(-30, 'minutes')) }, 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) + 1);
} }
static async get(_id: ObjectID): Promise<RecordDoc | null>; static async get(_id: ObjectID): Promise<RecordDoc | null>;

Loading…
Cancel
Save