mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
core: add monitor/collect hook
This commit is contained in:
2 files changed
+2
No files matched your search
@@ -47,6 +47,7 @@ export interface EventMap extends LifecycleEvents, HandlerEvents {
|
||||
'system/setting': (args: Record<string, any>) => VoidReturn
|
||||
'bus/broadcast': (event: keyof EventMap, ...args: any[]) => VoidReturn
|
||||
'monitor/update': (type: 'server' | 'judge', $set: any) => VoidReturn
|
||||
'monitor/collect': (info: any) => VoidReturn
|
||||
'api/update': () => void;
|
||||
'task/daily': () => void;
|
||||
|
||||
|
||||
@@ -49,6 +49,7 @@ export async function feedback(): Promise<[string, StatusUpdate]> {
|
||||
const status = await db.db.admin().serverStatus();
|
||||
info.dbVersion = status.version;
|
||||
} catch (e) { }
|
||||
await bus.serial('monitor/collect', info);
|
||||
const payload = dump(info, {
|
||||
replacer: (key, value) => {
|
||||
if (typeof value === 'function') return '';
|
||||
|
||||
Reference in new issue
Block a user