core: record: add index [domainId, pid]

This commit is contained in:
undefined committed 2024-06-26 00:00:10 +08:00
1 parent 7be29b19f6
commit 34f470d50f
7 files changed
+26 -25

No files matched your search

+2 -2
View File
@@ -51,8 +51,8 @@
"fs-extra": "^11.2.0",
"globby": "^14.0.1",
"inspectpack": "^4.7.1",
"mongodb-memory-server": "^9.3.0",
"nyc": "^15.1.0",
"mongodb-memory-server": "^9.4.0",
"nyc": "^17.0.0",
"ora": "^8.0.1",
"package-json": "^10.0.0",
"semver": "^7.6.2",
+1 -1
View File
@@ -6,6 +6,6 @@
"author": "undefined <i@undefined.moe>",
"license": "AGPL-3.0-or-later",
"dependencies": {
"@elastic/elasticsearch": "^8.13.1"
"@elastic/elasticsearch": "^8.14.0"
}
}
+5 -5
View File
@@ -4,15 +4,15 @@
"license": "MIT",
"main": "react.yaml",
"dependencies": {
"@stylistic/eslint-plugin": "^2.1.0",
"@typescript-eslint/eslint-plugin": "^7.13.0",
"@typescript-eslint/parser": "^7.13.0",
"@stylistic/eslint-plugin": "^2.2.2",
"@typescript-eslint/eslint-plugin": "^7.14.1",
"@typescript-eslint/parser": "^7.14.1",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-airbnb-typescript": "^18.0.0",
"eslint-plugin-github": "^5.0.1",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-jsx-a11y": "^6.8.0",
"eslint-plugin-react": "^7.34.2",
"eslint-plugin-jsx-a11y": "^6.9.0",
"eslint-plugin-react": "^7.34.3",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-simple-import-sort": "^12.1.0"
},
+2 -2
View File
@@ -7,14 +7,14 @@
"repository": "https://github.com/hydro-dev/Hydro.git",
"dependencies": {
"@hydrooj/utils": "workspace:^",
"adm-zip": "0.5.5",
"adm-zip": "0.5.14",
"cac": "^6.7.14",
"p-queue": "^8.0.1",
"schemastery": "^3.14.6",
"semver": "^7.6.2",
"shell-quote": "^1.8.1",
"superagent": "^9.0.2",
"ws": "^8.17.0"
"ws": "^8.17.1"
},
"preferUnplugged": true,
"license": "AGPL-3.0-or-later",
+8 -8
View File
@@ -12,23 +12,23 @@
},
"preferUnplugged": true,
"dependencies": {
"@aws-sdk/client-s3": "3.596.0",
"@aws-sdk/lib-storage": "3.596.0",
"@aws-sdk/s3-presigned-post": "3.596.0",
"@aws-sdk/s3-request-presigner": "3.596.0",
"@aws-sdk/client-s3": "3.600.0",
"@aws-sdk/lib-storage": "3.600.0",
"@aws-sdk/s3-presigned-post": "3.600.0",
"@aws-sdk/s3-request-presigner": "3.600.0",
"@graphql-tools/schema": "^10.0.4",
"@hydrooj/framework": "workspace:^",
"@hydrooj/utils": "workspace:^",
"@simplewebauthn/server": "7.4.0",
"@undefined-moe/require-resolve-hook": "^1.1.0",
"adm-zip": "0.5.5",
"adm-zip": "0.5.14",
"cac": "^6.7.14",
"cordis": "3.16.0",
"detect-browser": "^5.3.0",
"emoji-regex": "^10.3.0",
"emojis-list": "2.1.0",
"fs-extra": "^11.2.0",
"graphql": "^16.8.2",
"graphql": "^16.9.0",
"graphql-scalars": "^1.23.0",
"js-yaml": "^4.1.0",
"koa-proxies": "^0.12.4",
@@ -40,7 +40,7 @@
"mongodb": "^5.9.2",
"mongodb-uri": "^0.9.7",
"nanoid": "^5.0.7",
"nodemailer": "^6.9.13",
"nodemailer": "^6.9.14",
"notp": "^2.0.3",
"p-queue": "^8.0.1",
"path-to-regexp": "^6.2.2",
@@ -52,7 +52,7 @@
"superagent": "^9.0.2",
"tar": "6.2.1",
"thirty-two": "^1.0.2",
"ws": "^8.17.0"
"ws": "^8.17.1"
},
"devDependencies": {
"@types/adm-zip": "^0.4.34",
+7 -6
View File
@@ -280,22 +280,23 @@ export function apply(ctx: Context) {
}, { upsert: true });
}
});
ctx.on('ready', async () => {
await db.ensureIndexes(
ctx.on('ready', () => Promise.all([
db.ensureIndexes(
RecordModel.coll,
{ key: { domainId: 1, pid: 1 }, name: 'delete' },
{ key: { domainId: 1, contest: 1, _id: -1 }, name: 'basic' },
{ key: { domainId: 1, contest: 1, uid: 1, _id: -1 }, name: 'withUser' },
{ key: { domainId: 1, contest: 1, pid: 1, _id: -1 }, name: 'withProblem' },
{ key: { domainId: 1, contest: 1, pid: 1, uid: 1, _id: -1 }, name: 'withUserAndProblem' },
{ key: { domainId: 1, contest: 1, status: 1, _id: -1 }, name: 'withStatus' },
);
await db.ensureIndexes(
),
db.ensureIndexes(
RecordModel.collStat,
{ key: { domainId: 1, pid: 1, uid: 1, _id: -1 }, name: 'basic' },
{ key: { domainId: 1, pid: 1, uid: 1, time: 1 }, name: 'time' },
{ key: { domainId: 1, pid: 1, uid: 1, memory: 1 }, name: 'memory' },
{ key: { domainId: 1, pid: 1, uid: 1, length: 1 }, name: 'length' },
);
});
),
]) as any);
}
global.Hydro.model.record = RecordModel;
+1 -1
View File
@@ -14,7 +14,7 @@
"js-yaml": "^4.1.0",
"moment-timezone": "^0.5.45",
"mongodb": "^5.9.2",
"reggol": "^1.6.3",
"reggol": "^1.7.0",
"search-query-parser": "^1.6.0",
"systeminformation": "^5.22.11"
},