mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 17:36:08 +08:00
core: bug fix
This commit is contained in:
4 files changed
+21
-2
No files matched your search
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "hydrooj",
|
||||
"version": "4.9.8",
|
||||
"version": "4.9.9",
|
||||
"bin": "bin/hydrooj.js",
|
||||
"main": "src/plugin-api",
|
||||
"module": "src/plugin-api",
|
||||
|
||||
@@ -76,6 +76,9 @@ const acm = buildContestRule({
|
||||
}
|
||||
if (lockAt && j.rid.getTimestamp() > lockAt) {
|
||||
npending[j.pid]++;
|
||||
// FIXME this is tricky
|
||||
// @ts-ignore
|
||||
display[j.pid] ||= {};
|
||||
display[j.pid].npending = npending[j.pid];
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -23,6 +23,6 @@ export default async (ctx: KoaContext, next) => {
|
||||
}
|
||||
ctx.domainId = inferDomain?._id || domainId;
|
||||
ctx.domainInfo = inferDomain || absoluteDomain;
|
||||
if (domainId !== ctx.domainInfo._id) ctx.redirect(ctx.originalPath.replace(/^\/d\/[^/]+\//, `/d/${ctx.domainInfo._id}/`));
|
||||
if (ctx.domainId !== ctx.domainInfo._id) ctx.redirect(ctx.originalPath.replace(/^\/d\/[^/]+\//, `/d/${ctx.domainInfo._id}/`));
|
||||
else await next();
|
||||
};
|
||||
@@ -555,6 +555,22 @@ const scripts: UpgradeScript[] = [
|
||||
await document.coll.updateMany({ docType: document.TYPE_DISCUSSION }, { $set: { hidden: false } });
|
||||
return true;
|
||||
},
|
||||
async function _78_79() {
|
||||
const t = await document.collStatus.find({
|
||||
docType: document.TYPE_CONTEST, journal: { $elemMatch: { rid: null } },
|
||||
}).toArray();
|
||||
for (const r of t) {
|
||||
r.journal = r.journal.filter((i) => i.rid !== null);
|
||||
await document.collStatus.updateOne({ _id: r._id }, { $set: { journal: r.journal } });
|
||||
}
|
||||
await iterateAllContest(async (tdoc) => {
|
||||
if (tdoc.rule !== 'acm') return;
|
||||
logger.info(tdoc.domainId, tdoc.title);
|
||||
await contest.recalcStatus(tdoc.domainId, tdoc.docId);
|
||||
if (contest.isDone(tdoc)) await contest.unlockScoreboard(tdoc.domainId, tdoc.docId);
|
||||
});
|
||||
return true;
|
||||
},
|
||||
];
|
||||
|
||||
export default scripts;
|
||||
Reference in new issue
Block a user