mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: pm2 cluster management
This commit is contained in:
1 parent
9f5c00a985
commit
448c398d21
30 files changed
+206
-427
No files matched your search
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@hydrooj/hydrojudge",
|
||||
"bin": "bin/hydrojudge.js",
|
||||
"version": "2.10.15",
|
||||
"version": "2.11.0",
|
||||
"main": "package.json",
|
||||
"author": "undefined <i@undefined.moe>",
|
||||
"repository": "https://github.com/hydro-dev/Hydro.git",
|
||||
|
||||
@@ -123,7 +123,6 @@ export async function del(fileId: string) {
|
||||
|
||||
export async function run(execute, params?) {
|
||||
let result;
|
||||
global.reqCount++;
|
||||
// eslint-disable-next-line no-return-await
|
||||
if (typeof execute === 'object') return await runMultiple(execute);
|
||||
try {
|
||||
|
||||
@@ -34,7 +34,7 @@ const logger = new Logger('judge');
|
||||
|
||||
async function postInit() {
|
||||
// Only start a single daemon
|
||||
if (!global.Hydro.isFirstWorker) return;
|
||||
if (process.env.NODE_APP_INSTANCE !== '0') return;
|
||||
const judge = require('./judge');
|
||||
|
||||
const {
|
||||
|
||||
@@ -55,11 +55,3 @@ export async function get() {
|
||||
info.stack = await stackSize();
|
||||
return info;
|
||||
}
|
||||
|
||||
declare global {
|
||||
namespace NodeJS {
|
||||
interface Global {
|
||||
reqCount: number,
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user