mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
bug fixes
This commit is contained in:
1 parent
41e10e49f5
commit
1210957a2a
4 files changed
+10
-11
No files matched your search
@@ -127,7 +127,6 @@ class FpsProblemImportHandler extends Handler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const sideEffect = true;
|
|
||||||
export async function apply(ctx: Context) {
|
export async function apply(ctx: Context) {
|
||||||
ctx.Route('problem_import_fps', '/problem/import/fps', FpsProblemImportHandler, PERM.PERM_CREATE_PROBLEM);
|
ctx.Route('problem_import_fps', '/problem/import/fps', FpsProblemImportHandler, PERM.PERM_CREATE_PROBLEM);
|
||||||
ctx.inject('ProblemAdd', 'problem_import_fps', { icon: 'copy', text: 'From FPS File' });
|
ctx.inject('ProblemAdd', 'problem_import_fps', { icon: 'copy', text: 'From FPS File' });
|
||||||
|
|||||||
@@ -4,17 +4,16 @@ import path from 'path';
|
|||||||
import fs from 'fs-extra';
|
import fs from 'fs-extra';
|
||||||
import type { JudgeResultBody } from 'hydrooj';
|
import type { JudgeResultBody } from 'hydrooj';
|
||||||
import {
|
import {
|
||||||
Logger, SettingModel, StorageModel, SystemModel, TaskModel,
|
SettingModel, StorageModel, SystemModel, TaskModel,
|
||||||
} from 'hydrooj';
|
} from 'hydrooj';
|
||||||
import { end, next } from 'hydrooj/src/handler/judge';
|
import { end, next } from 'hydrooj/src/handler/judge';
|
||||||
import { processTestdata } from '../cases';
|
import { processTestdata } from '../cases';
|
||||||
import { getConfig } from '../config';
|
import { getConfig } from '../config';
|
||||||
import { FormatError, SystemError } from '../error';
|
import { FormatError, SystemError } from '../error';
|
||||||
import { Context } from '../judge/interface';
|
import { Context } from '../judge/interface';
|
||||||
|
import logger from '../log';
|
||||||
import { JudgeTask } from '../task';
|
import { JudgeTask } from '../task';
|
||||||
|
|
||||||
const logger = new Logger('judge');
|
|
||||||
|
|
||||||
const session = {
|
const session = {
|
||||||
config: { detail: SystemModel.get('hydrojudge.detail') },
|
config: { detail: SystemModel.get('hydrojudge.detail') },
|
||||||
async fetchFile(name: string) {
|
async fetchFile(name: string) {
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ declare module 'hydrooj' {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function apply(ctx: Context) {
|
export function apply(ctx: Context) {
|
||||||
if (process.env.NODE_APP_INSTANCE === '0') {
|
if (process.env.NODE_APP_INSTANCE !== '0') return;
|
||||||
ctx.once('app/started', () => require('./hosts/builtin').postInit());
|
ctx.once('app/started', () => require('./hosts/builtin').postInit());
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -370,10 +370,11 @@ export async function run({
|
|||||||
const ddocs = await query('SELECT * FROM `article`');
|
const ddocs = await query('SELECT * FROM `article`');
|
||||||
const didMap = {};
|
const didMap = {};
|
||||||
for (const ddoc of ddocs) {
|
for (const ddoc of ddocs) {
|
||||||
|
const _id = Time.getObjectID(new Date(ddoc.public_time * 1000), false);
|
||||||
const data: Partial<DiscussionDoc> = {
|
const data: Partial<DiscussionDoc> = {
|
||||||
_id: Time.getObjectID(new Date(ddoc.public_time * 1000), false),
|
_id,
|
||||||
docType: DocumentModel.TYPE_DISCUSSION,
|
docType: DocumentModel.TYPE_DISCUSSION,
|
||||||
docId: Time.getObjectID(new Date(ddoc.public_time * 1000), false),
|
docId: _id,
|
||||||
owner: uidMap[ddoc.user_id] || 0,
|
owner: uidMap[ddoc.user_id] || 0,
|
||||||
title: ddoc.title,
|
title: ddoc.title,
|
||||||
content: ddoc.content,
|
content: ddoc.content,
|
||||||
@@ -401,10 +402,11 @@ export async function run({
|
|||||||
*/
|
*/
|
||||||
const drdocs = await query('SELECT * FROM `article_comment`');
|
const drdocs = await query('SELECT * FROM `article_comment`');
|
||||||
for (const drdoc of drdocs) {
|
for (const drdoc of drdocs) {
|
||||||
|
const _id = Time.getObjectID(new Date(drdoc.public_time * 1000), false);
|
||||||
const data: Partial<DiscussionReplyDoc> = {
|
const data: Partial<DiscussionReplyDoc> = {
|
||||||
_id: Time.getObjectID(new Date(drdoc.public_time * 1000), false),
|
_id,
|
||||||
domainId,
|
domainId,
|
||||||
docId: Time.getObjectID(new Date(drdoc.public_time * 1000), false),
|
docId: _id,
|
||||||
docType: DocumentModel.TYPE_DISCUSSION_REPLY,
|
docType: DocumentModel.TYPE_DISCUSSION_REPLY,
|
||||||
content: drdoc.content,
|
content: drdoc.content,
|
||||||
owner: uidMap[drdoc.user_id],
|
owner: uidMap[drdoc.user_id],
|
||||||
|
|||||||
Reference in new issue
Block a user