core: fix validation

pull/555/head
undefined 2 years ago
parent 7e7a714b02
commit bf33ffa640
No known key found for this signature in database

@ -1,6 +1,6 @@
{
"name": "hydrooj",
"version": "4.9.11",
"version": "4.9.12",
"bin": "bin/hydrooj.js",
"main": "src/plugin-api",
"module": "src/plugin-api",
@ -12,11 +12,11 @@
},
"preferUnplugged": true,
"dependencies": {
"@aws-sdk/client-s3": "^3.290.0",
"@aws-sdk/lib-storage": "^3.290.0",
"@aws-sdk/middleware-endpoint": "^3.290.0",
"@aws-sdk/s3-presigned-post": "^3.290.0",
"@aws-sdk/s3-request-presigner": "^3.290.0",
"@aws-sdk/client-s3": "^3.306.0",
"@aws-sdk/lib-storage": "^3.306.0",
"@aws-sdk/middleware-endpoint": "^3.306.0",
"@aws-sdk/s3-presigned-post": "^3.306.0",
"@aws-sdk/s3-request-presigner": "^3.306.0",
"@graphql-tools/schema": "^9.0.17",
"@hydrooj/utils": "workspace:*",
"@simplewebauthn/server": "^7.2.0",
@ -39,9 +39,9 @@
"lodash": "^4.17.21",
"lru-cache": "7.14.1",
"mime-types": "^2.1.35",
"moment-timezone": "^0.5.41",
"mongodb": "^5.1.0",
"nanoid": "^4.0.1",
"moment-timezone": "^0.5.43",
"mongodb": "^5.2.0",
"nanoid": "^4.0.2",
"nodemailer": "^6.9.1",
"notp": "^2.0.3",
"p-queue": "^7.3.4",
@ -60,11 +60,11 @@
"@types/adm-zip": "^0.4.34",
"@types/fs-extra": "^11.0.1",
"@types/js-yaml": "^4.0.5",
"@types/koa": "^2.13.5",
"@types/koa": "^2.13.6",
"@types/koa-compress": "^4.0.3",
"@types/koa-router": "^7.4.4",
"@types/koa-static-cache": "^5.1.1",
"@types/lodash": "^4.14.191",
"@types/lodash": "^4.14.192",
"@types/mime-types": "^2.1.1",
"@types/nodemailer": "^6.4.7",
"@types/notp": "^2.0.2",

@ -1,4 +1,5 @@
import child from 'child_process';
import path from 'path';
import { CAC } from 'cac';
import fs from 'fs-extra';
import superagent from 'superagent';
@ -17,7 +18,7 @@ export function register(cli: CAC) {
const res = await superagent.get(patch);
logger.info('Downloaded patch');
for (let i = 0; i <= 100; i++) {
const fp = `${mod}.${i}.patch`;
const fp = path.join(path.dirname(mod), `${mod}.${i}.patch`);
if (fs.existsSync(fp)) continue;
patch = fp;
break;

@ -574,8 +574,11 @@ const scripts: UpgradeScript[] = [
return await iterateAllDomain(async ({ _id }) => {
const cursor = discussion.getMulti(_id, { parentType: document.TYPE_CONTEST });
for await (const ddoc of cursor) {
const tdoc = await contest.get(_id, ddoc.parentId as ObjectId);
if (!tdoc) await discussion.del(_id, ddoc.docId);
try {
await contest.get(_id, ddoc.parentId as ObjectId);
} catch (e) {
await discussion.del(_id, ddoc.docId);
}
}
});
},

Loading…
Cancel
Save