mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
2.0.0(preview)
This commit is contained in:
1 parent
d5929d78b1
commit
1c8b62a6d9
33 files changed
+307
-241
No files matched your search
@@ -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 },
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user