mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: loader: support profile
This commit is contained in:
9 files changed
+73
-68
No files matched your search
@@ -5,7 +5,7 @@ import {
|
||||
import mongoUri from 'mongodb-uri';
|
||||
import { Time } from '@hydrooj/utils';
|
||||
import { Logger } from '../logger';
|
||||
import options from '../options';
|
||||
import { load } from '../options';
|
||||
import * as bus from './bus';
|
||||
|
||||
const logger = new Logger('mongo');
|
||||
@@ -37,7 +37,7 @@ class MongoService {
|
||||
}
|
||||
|
||||
async start() {
|
||||
const opts = options() || {};
|
||||
const opts = load() || {};
|
||||
let mongourl = MongoService.buildUrl(opts);
|
||||
const url = mongoUri.parse(mongourl);
|
||||
if (process.env.CI) {
|
||||
|
||||
@@ -127,7 +127,6 @@ export class ConnectionHandler extends ConnectionHandlerOriginal {
|
||||
}
|
||||
|
||||
export async function apply(ctx: Context) {
|
||||
if (process.env.HYDRO_CLI) return;
|
||||
ctx.plugin(require('@hydrooj/framework'), {
|
||||
keys: system.get('session.keys'),
|
||||
proxy: !!system.get('server.xproxy') || !!system.get('server.xff'),
|
||||
@@ -137,6 +136,7 @@ export async function apply(ctx: Context) {
|
||||
xff: system.get('server.xff'),
|
||||
xhost: system.get('server.xhost'),
|
||||
});
|
||||
if (process.env.HYDRO_CLI) return;
|
||||
ctx.inject(['server'], ({ server, on }) => {
|
||||
const proxyMiddleware = proxy('/fs', {
|
||||
target: builtinConfig.file.endPoint,
|
||||
|
||||
Reference in new issue
Block a user