mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +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
@@ -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 };
|
||||
|
||||
Reference in new issue
Block a user