mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
core: record: add index [domainId, pid]
This commit is contained in:
7 files changed
+26
-25
No files matched your search
@@ -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",
|
||||
|
||||
@@ -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;
|
||||
Reference in new issue
Block a user