mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
重测整题功能
This commit is contained in:
1 parent
7a4d5209b8
commit
76b001305d
6 files changed
+31
-4
No files matched your search
@@ -217,6 +217,17 @@ class ProblemDetailHandler extends ProblemHandler {
|
||||
}
|
||||
this.response.redirect = this.url('problem_settings', { domainId: destDomainId, pid });
|
||||
}
|
||||
|
||||
@param('pid', Types.UnsignedInt)
|
||||
async postRejudge(domainId: string, pid: number) {
|
||||
this.checkPerm(PERM.PERM_REJUDGE_PROBLEM);
|
||||
// TODO maybe async?
|
||||
await record.getMulti(domainId, { pid }).forEach(async (doc) => {
|
||||
await record.reset(domainId, doc._id, true);
|
||||
await record.judge(domainId, doc._id);
|
||||
});
|
||||
this.back();
|
||||
}
|
||||
}
|
||||
|
||||
class ProblemSubmitHandler extends ProblemDetailHandler {
|
||||
|
||||
@@ -207,13 +207,13 @@ export async function load() {
|
||||
const cnt = await entry({ entry: 'master' });
|
||||
logger.info('Master started');
|
||||
cluster.on('exit', (worker, code, signal) => {
|
||||
logger.info(`Worker ${worker.process.pid} ${worker.id} exit: ${code} ${signal}`);
|
||||
logger.warn(`Worker ${worker.process.pid} ${worker.id} exit: ${code} ${signal}`);
|
||||
});
|
||||
cluster.on('disconnect', (worker) => {
|
||||
logger.info(`Worker ${worker.process.pid} ${worker.id} disconnected`);
|
||||
});
|
||||
cluster.on('listening', (worker, address) => {
|
||||
logger.info(`Worker ${worker.process.pid} ${worker.id} listening at `, address);
|
||||
logger.success(`Worker ${worker.process.pid} ${worker.id} listening at `, address);
|
||||
});
|
||||
cluster.on('online', (worker) => {
|
||||
logger.success(`Worker ${worker.process.pid} ${worker.id} is online`);
|
||||
|
||||
@@ -3,10 +3,12 @@ import moment from 'moment-timezone';
|
||||
import { Dictionary } from 'lodash';
|
||||
import * as builtin from './builtin';
|
||||
import { Setting as _Setting } from '../interface';
|
||||
import { Logger } from '../logger';
|
||||
import * as bus from '../service/bus';
|
||||
|
||||
type SettingDict = Dictionary<_Setting>;
|
||||
|
||||
const logger = new Logger('model/setting');
|
||||
const countries = moment.tz.countries();
|
||||
const tzs = new Set();
|
||||
for (const country of countries) {
|
||||
@@ -141,6 +143,7 @@ SystemSetting(
|
||||
);
|
||||
|
||||
bus.once('app/started', async () => {
|
||||
logger.debug('Ensuring settings');
|
||||
for (const setting of SYSTEM_SETTINGS) {
|
||||
if (setting.value) {
|
||||
// @ts-ignore
|
||||
|
||||
Reference in new issue
Block a user