judge: daemon mode

This commit is contained in:
undefined committed 2020-10-27 13:05:29 +08:00
1 parent 9a58c28a91
commit 156d931811
12 files changed
+14 -14

No files matched your search

+1 -1
View File
@@ -1,3 +1,3 @@
#!/bin/env node
require('./dist/daemon')()
require('../dist/daemon')();
+2 -1
View File
@@ -1,6 +1,7 @@
{
"name": "@hydrooj/hydrojudge",
"version": "2.0.15",
"bin": "bin/hydrojudge.js",
"version": "2.1.0",
"main": "package.json",
"author": "masnn",
"dependencies": {
+1 -1
View File
@@ -1,6 +1,6 @@
/* eslint-disable no-template-curly-in-string */
import { STATUS } from 'hydrooj/dist/model/builtin';
import fs from 'fs-extra';
import * as STATUS from './status';
import { run } from './sandbox';
import { SystemError } from './error';
+1 -1
View File
@@ -1,5 +1,5 @@
import yaml from 'js-yaml';
import { STATUS } from 'hydrooj/dist/model/builtin';
import * as STATUS from './status';
import { run, del } from './sandbox';
import { CompileError, SystemError } from './error';
import { compilerText } from './utils';
+1 -1
View File
@@ -1,4 +1,4 @@
import { STATUS_TEXTS } from 'hydrooj/dist/model/builtin';
import { STATUS_TEXTS } from './status';
export class CompileError extends Error {
stdout: string;
+1 -1
View File
@@ -2,7 +2,7 @@ import Queue from 'p-queue';
import path from 'path';
import fs from 'fs-extra';
import { argv } from 'yargs';
import { STATUS } from 'hydrooj/dist/model/builtin';
import * as STATUS from '../status';
import { CompileError, SystemError } from '../error';
import { copyInDir, parseFilename } from '../utils';
import { run } from '../sandbox';
+1 -1
View File
@@ -1,7 +1,7 @@
// Not implemented
import path from 'path';
import fs from 'fs-extra';
import { STATUS } from 'hydrooj/dist/model/builtin';
import * as STATUS from '../status';
import { CompileError } from '../error';
import { copyInDir, parseFilename } from '../utils';
import { run } from '../sandbox';
+1 -1
View File
@@ -1,6 +1,6 @@
import Queue from 'p-queue';
import fs from 'fs-extra';
import { STATUS } from 'hydrooj/dist/model/builtin';
import * as STATUS from '../status';
import { parseFilename } from '../utils';
import { run } from '../sandbox';
import compile from '../compile';
+1 -1
View File
@@ -1,7 +1,7 @@
import fs from 'fs-extra';
import path from 'path';
import { argv } from 'yargs';
import { STATUS } from 'hydrooj/dist/model/builtin';
import * as STATUS from '../status';
import { run } from '../sandbox';
import compile from '../compile';
import signals from '../signals';
@@ -1,4 +1,4 @@
import { STATUS } from 'hydrooj/dist/model/builtin';
import * as STATUS from '../status';
import { check } from '../check';
export async function judge({
+1 -1
View File
@@ -1,6 +1,6 @@
import Axios from 'axios';
import fs from 'fs-extra';
import { STATUS } from 'hydrooj/dist/model/builtin';
import * as STATUS from './status';
import { SystemError } from './error';
import { cmd } from './utils';
+2 -3
View File
@@ -1,11 +1,10 @@
import child from 'child_process';
import fs from 'fs-extra';
import os from 'os';
import { Logger } from 'hydrooj/dist/logger';
import log from './log';
const logger = new Logger('judge');
const linux = os.platform() === 'linux';
if (!linux) logger.warn('Not running on linux. tmpfs disabled.');
if (!linux) log.warn('Not running on linux. tmpfs disabled.');
export function mount(path: string, size = '32m') {
fs.ensureDirSync(path);