mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
添加problem/[get list edit]等钩子,添加task.priority
This commit is contained in:
1 parent
7d25830ea3
commit
829cbac937
9 files changed
+48
-27
No files matched your search
@@ -7,19 +7,23 @@ const coll = db.collection('status');
|
||||
|
||||
export async function update() {
|
||||
const [mid, $set] = await sysinfo.update();
|
||||
$set.updateAt = new Date();
|
||||
$set.reqCount = global.Hydro.stat.reqCount;
|
||||
await bus.serial('monitor/update', 'server', $set);
|
||||
await coll.updateOne(
|
||||
{ mid, type: 'server' },
|
||||
{ $set: { ...$set, updateAt: new Date(), reqCount: global.Hydro.stat.reqCount } },
|
||||
{ $set },
|
||||
{ upsert: true },
|
||||
);
|
||||
global.Hydro.stat.reqCount = 0;
|
||||
}
|
||||
|
||||
export function updateJudger(args) {
|
||||
args.type = 'judger';
|
||||
return coll.updateOne(
|
||||
export async function updateJudger(args) {
|
||||
const $set = { ...args, updateAt: new Date() };
|
||||
await bus.serial('monitor/update', 'judger', $set);
|
||||
return await coll.updateOne(
|
||||
{ mid: args.mid, type: 'judger' },
|
||||
{ $set: { ...args, updateAt: new Date() } },
|
||||
{ $set },
|
||||
{ upsert: true },
|
||||
);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user