judge: fix testdata sync

This commit is contained in:
undefined committed 2021-08-19 11:07:27 +08:00
1 parent e042cef4fa
commit e56655abef
6 files changed
+7 -6

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "hydrooj",
"version": "2.32.28",
"version": "2.32.29",
"bin": "bin/hydrooj.js",
"main": "src/loader",
"module": "src/loader",
+2 -1
View File
@@ -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: '' };
+1 -2
View File
@@ -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);
}
}
+1
View File
@@ -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 };
+1 -1
View File
@@ -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 -1
View File
@@ -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",