2.0.0(preview)

This commit is contained in:
masnn committed 2020-06-08 13:41:43 +08:00
1 parent d5929d78b1
commit 1c8b62a6d9
33 files changed
+307 -241

No files matched your search

+3 -3
View File
@@ -4,9 +4,9 @@ const sysinfo = require('../lib/sysinfo');
const coll = db.collection('status');
async function update() {
const [_id, $set] = await sysinfo.update();
const [mid, $set] = await sysinfo.update();
await coll.updateOne(
{ _id },
{ mid, type: 'server' },
{ $set: { ...$set, updateAt: new Date() } },
{ upsert: true },
);
@@ -15,7 +15,7 @@ async function update() {
async function postInit() {
const info = await sysinfo.get();
await coll.updateOne(
{ _id: info._id },
{ mid: info.mid, type: 'server' },
{ $set: { ...info, updateAt: new Date(), type: 'server' } },
{ upsert: true },
);