添加problem/[get list edit]等钩子,添加task.priority

This commit is contained in:
undefined committed 2020-09-15 23:12:38 +08:00
1 parent 7d25830ea3
commit 829cbac937
9 files changed
+48 -27

No files matched your search

+9 -5
View File
@@ -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 },
);
}