core: update priority calculation

This commit is contained in:
undefined committed 2022-06-03 12:17:32 +08:00
1 parent 792f1c6266
commit 00176ddb14
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -30,7 +30,7 @@ class RecordModel {
const pending = await task.count({ uid, rejudged: { $ne: true } });
const timeRecent = await RecordModel.coll
.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>;