Github Oauth,支持自动转换config.ini配置

This commit is contained in:
undefined committed 2020-06-21 13:37:55 +08:00
1 parent 5707f973d7
commit 8476eac3b4
17 files changed
+240 -109

No files matched your search

+3 -2
View File
@@ -7,9 +7,10 @@ async function update() {
const [mid, $set] = await sysinfo.update();
await coll.updateOne(
{ mid, type: 'server' },
{ $set: { ...$set, updateAt: new Date() } },
{ $set: { ...$set, updateAt: new Date(), reqCount: global.Hydro.stat.reqCount } },
{ upsert: true },
);
global.Hydro.stat.reqCount = 0;
}
async function postInit() {
@@ -19,7 +20,7 @@ async function postInit() {
{ $set: { ...info, updateAt: new Date(), type: 'server' } },
{ upsert: true },
);
setInterval(update, 3 * 60 * 1000);
setInterval(update, 60 * 1000);
}
global.Hydro.service.monitor = module.exports = { postInit };
+2
View File
@@ -133,6 +133,7 @@ class Handler {
files: ctx.request.files,
query: ctx.query,
path: ctx.path,
referer: ctx.request.headers.referer || '/',
};
this.response = {
body: '',
@@ -348,6 +349,7 @@ class Handler {
}
async function handle(ctx, HandlerClass, permission) {
global.Hydro.stat.reqCount++;
const h = new HandlerClass(ctx);
try {
const method = ctx.method.toLowerCase();