mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 17:36:08 +08:00
judge: fix testdata sync
This commit is contained in:
1 parent
e042cef4fa
commit
e56655abef
6 files changed
+7
-6
No files matched your search
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "hydrooj",
|
||||
"version": "2.32.28",
|
||||
"version": "2.32.29",
|
||||
"bin": "bin/hydrooj.js",
|
||||
"main": "src/loader",
|
||||
"module": "src/loader",
|
||||
|
||||
@@ -11,11 +11,11 @@ import * as contest from '../model/contest';
|
||||
import domain from '../model/domain';
|
||||
import task from '../model/task';
|
||||
import * as system from '../model/system';
|
||||
import storage from '../model/storage';
|
||||
import * as bus from '../service/bus';
|
||||
import {
|
||||
Route, Handler, Connection, ConnectionHandler, post, Types,
|
||||
} from '../service/server';
|
||||
import storage from '../service/storage';
|
||||
import { updateJudge } from '../service/monitor';
|
||||
|
||||
const logger = new Logger('judge');
|
||||
@@ -81,6 +81,7 @@ export async function next(body: JudgeResultBody) {
|
||||
export async function end(body: JudgeResultBody) {
|
||||
if (body.rid) body.rid = new ObjectID(body.rid);
|
||||
let rdoc = await record.get(body.rid);
|
||||
if (!rdoc) return;
|
||||
const $set: Partial<RecordDoc> = {};
|
||||
const $push: any = {};
|
||||
const $unset: any = { progress: '' };
|
||||
|
||||
@@ -88,8 +88,7 @@ export class StorageModel {
|
||||
{ path: target, autoDelete: { $exists: false } },
|
||||
{ $set: { lastUsage: new Date() } },
|
||||
);
|
||||
if (!res.value) return await storage.signDownloadLink(target, filename, noExpire, useAlternativeEndpointFor);
|
||||
return await storage.signDownloadLink(res.value._id, filename, noExpire, useAlternativeEndpointFor);
|
||||
return await storage.signDownloadLink(res.value?._id || target, filename, noExpire, useAlternativeEndpointFor);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -838,6 +838,7 @@ export function Connection(
|
||||
const sock = sockjs.createServer({ prefix, log });
|
||||
const checker = Checker(permPrivChecker);
|
||||
sock.on('connection', async (conn) => {
|
||||
if (!conn) return;
|
||||
const h: Dictionary<any> = new RouteConnHandler(conn);
|
||||
try {
|
||||
const args = { domainId: 'system', ...h.request.params };
|
||||
|
||||
@@ -275,7 +275,7 @@ export namespace Time {
|
||||
export function errorMessage(err: Error | string) {
|
||||
const t = typeof err === 'string' ? err : err.stack;
|
||||
const parsed = t
|
||||
.replace(/[A-Z]:\\.+\\@hydrooj\\/g, '\\')
|
||||
.replace(/[A-Z]:\\.+\\@hydrooj\\/g, '@hydrooj\\')
|
||||
.replace(/\/.+\/@hydrooj\//g, '\\')
|
||||
.replace(/[A-Z]:\\.+\\hydrooj\\/g, 'hydrooj\\')
|
||||
.replace(/\/.+\/hydrooj\//g, 'hydrooj/')
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@hydrooj/utils",
|
||||
"version": "1.1.2",
|
||||
"version": "1.1.3",
|
||||
"description": "hydrooj utils",
|
||||
"main": "package.json",
|
||||
"repository": "https://github.com/hydro-dev/Hydro.git",
|
||||
|
||||
Reference in new issue
Block a user