mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +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",
|
"name": "hydrooj",
|
||||||
"version": "4.9.8",
|
"version": "4.9.9",
|
||||||
"bin": "bin/hydrooj.js",
|
"bin": "bin/hydrooj.js",
|
||||||
"main": "src/plugin-api",
|
"main": "src/plugin-api",
|
||||||
"module": "src/plugin-api",
|
"module": "src/plugin-api",
|
||||||
|
|||||||
@@ -76,6 +76,9 @@ const acm = buildContestRule({
|
|||||||
}
|
}
|
||||||
if (lockAt && j.rid.getTimestamp() > lockAt) {
|
if (lockAt && j.rid.getTimestamp() > lockAt) {
|
||||||
npending[j.pid]++;
|
npending[j.pid]++;
|
||||||
|
// FIXME this is tricky
|
||||||
|
// @ts-ignore
|
||||||
|
display[j.pid] ||= {};
|
||||||
display[j.pid].npending = npending[j.pid];
|
display[j.pid].npending = npending[j.pid];
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,6 @@ export default async (ctx: KoaContext, next) => {
|
|||||||
}
|
}
|
||||||
ctx.domainId = inferDomain?._id || domainId;
|
ctx.domainId = inferDomain?._id || domainId;
|
||||||
ctx.domainInfo = inferDomain || absoluteDomain;
|
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();
|
else await next();
|
||||||
};
|
};
|
||||||
@@ -555,6 +555,22 @@ const scripts: UpgradeScript[] = [
|
|||||||
await document.coll.updateMany({ docType: document.TYPE_DISCUSSION }, { $set: { hidden: false } });
|
await document.coll.updateMany({ docType: document.TYPE_DISCUSSION }, { $set: { hidden: false } });
|
||||||
return true;
|
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;
|
export default scripts;
|
||||||
Reference in new issue
Block a user