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

+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 };