mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 17:36:08 +08:00
core: judge priority fix
This commit is contained in:
1 parent
880bbbf56f
commit
4c80aa888e
2 files changed
+3
-3
No files matched your search
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "hydrooj",
|
||||
"version": "2.23.17",
|
||||
"version": "2.23.18",
|
||||
"bin": "bin/hydrooj.js",
|
||||
"main": "dist/loader.js",
|
||||
"typings": "dist/loader.d.ts",
|
||||
|
||||
@@ -20,7 +20,7 @@ class RecordModel {
|
||||
const pending = await task.count({ uid });
|
||||
const timeRecent = await RecordModel.coll
|
||||
.find({ _id: { $gte: Time.getObjectID(moment().add(-1, 'hour')) }, uid }).project({ time: 1 }).toArray();
|
||||
return -(pending * (sum(timeRecent.map((i) => i.time || 0)) / 1000));
|
||||
return -(pending * (sum(timeRecent.map((i) => i.time || 0)) / 100000));
|
||||
}
|
||||
|
||||
static async get(domainId: string, _id: ObjectID): Promise<Rdoc | null> {
|
||||
@@ -95,7 +95,7 @@ class RecordModel {
|
||||
const res = await RecordModel.coll.insertOne(data);
|
||||
if (addTask) {
|
||||
const priority = await RecordModel.submissionPriority(uid);
|
||||
await RecordModel.judge(domainId, res.insertedId, 1 - priority);
|
||||
await RecordModel.judge(domainId, res.insertedId, 1 + priority);
|
||||
}
|
||||
return res.insertedId;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user