core: update to mongodb5 (#514)

This commit is contained in:
undefined authored and GitHub committed 2023-02-27 18:31:24 +08:00
1 parent 5a02010120
commit 0685b88066
59 files changed
+610 -601

No files matched your search

+1 -1
View File
@@ -9,7 +9,7 @@
"@hydrooj/utils": "workspace:*",
"cac": "^6.7.14",
"fs-extra": "^11.1.0",
"mongodb": "^3.7.3",
"mongodb": "^5.1.0",
"p-queue": "^7.3.4",
"schemastery": "^3.7.1",
"shell-quote": "^1.8.0",
+3 -3
View File
@@ -1,7 +1,7 @@
/* eslint-disable no-await-in-loop */
import path from 'path';
import fs from 'fs-extra';
import { ObjectID } from 'mongodb';
import { ObjectId } from 'mongodb';
import PQueue from 'p-queue';
import superagent from 'superagent';
import WebSocket from 'ws';
@@ -143,8 +143,8 @@ export default class Hydro {
return null;
}
send(rid: string | ObjectID, key: 'next' | 'end', data: Partial<JudgeResultBody>) {
data.rid = new ObjectID(rid);
send(rid: string | ObjectId, key: 'next' | 'end', data: Partial<JudgeResultBody>) {
data.rid = new ObjectId(rid);
data.key = key;
if (data.case && typeof data.case.message === 'string') data.case.message = removeNixPath(data.case.message);
if (typeof data.message === 'string') data.message = removeNixPath(data.message);