vjudge: add CheckService (#599)

This commit is contained in:
panda authored and GitHub committed 2023-06-30 00:52:25 +08:00
1 parent 807bfb53e3
commit 9da4340a97
8 files changed
+129 -62

No files matched your search

+2 -2
View File
@@ -3,7 +3,6 @@ import { inspect } from 'util';
import * as yaml from 'js-yaml';
import { omit } from 'lodash';
import Schema from 'schemastery';
import * as check from '../check';
import {
CannotEditSuperAdminError, NotLaunchedByPM2Error, UserNotFoundError, ValidationError,
} from '../error';
@@ -14,6 +13,7 @@ import record from '../model/record';
import * as setting from '../model/setting';
import * as system from '../model/system';
import user from '../model/user';
import { check } from '../service/check';
import {
ConnectionHandler, Handler, param, requireSudo, Types,
} from '../service/server';
@@ -71,7 +71,7 @@ class SystemCheckConnHandler extends ConnectionHandler {
const log = (payload: any) => this.send({ type: 'log', payload });
const warn = (payload: any) => this.send({ type: 'warn', payload });
const error = (payload: any) => this.send({ type: 'error', payload });
await check.start(this, log, warn, error, (id) => { this.id = id; });
await check.run(this, log, warn, error, (id) => { this.id = id; });
}
async cleanup() {