mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
Merge branch 'master' of https://github.com/hydro-dev/Hydro
This commit is contained in:
commit
48565ce711
2 files changed
+4
-3
No files matched your search
@@ -144,7 +144,7 @@ Worker.addHandler('task.daily', async () => {
|
|||||||
await global.Hydro.script.rp?.run({}, new Logger('task/rp').debug);
|
await global.Hydro.script.rp?.run({}, new Logger('task/rp').debug);
|
||||||
await global.Hydro.script.problemStat?.run({}, new Logger('task/problem').debug);
|
await global.Hydro.script.problemStat?.run({}, new Logger('task/problem').debug);
|
||||||
if (global.Hydro.model.system.get('server.checkUpdate')) {
|
if (global.Hydro.model.system.get('server.checkUpdate')) {
|
||||||
await global.Hydro.script.checkVersion?.run({}, new Logger('task/checkUpdate').debug);
|
await global.Hydro.script.checkUpdate?.run({}, new Logger('task/checkUpdate').debug);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
bus.on('domain/delete', (domainId) => coll.deleteMany({ domainId }));
|
bus.on('domain/delete', (domainId) => coll.deleteMany({ domainId }));
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ async function getRemoteVersion(id: string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function run() {
|
export async function run(_: {}, report: Function) {
|
||||||
const current = global.Hydro.version;
|
const current = global.Hydro.version;
|
||||||
const message = [''];
|
const message = [''];
|
||||||
for (const name in current) {
|
for (const name in current) {
|
||||||
@@ -24,7 +24,7 @@ export async function run() {
|
|||||||
const remote = await getRemoteVersion(id);
|
const remote = await getRemoteVersion(id);
|
||||||
if (!remote) continue;
|
if (!remote) continue;
|
||||||
const stored = system.get(`checkVersion.${id}`);
|
const stored = system.get(`checkVersion.${id}`);
|
||||||
if (semver.lt(stored, remote)) {
|
if (!stored || semver.lt(stored, remote)) {
|
||||||
system.set(`checkVersion.${id}`, remote);
|
system.set(`checkVersion.${id}`, remote);
|
||||||
if (semver.lt(current[name], remote)) {
|
if (semver.lt(current[name], remote)) {
|
||||||
message.push(`${id}\t${current[name]} -> ${remote}`);
|
message.push(`${id}\t${current[name]} -> ${remote}`);
|
||||||
@@ -32,6 +32,7 @@ export async function run() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (message.length > 1) {
|
if (message.length > 1) {
|
||||||
|
report({ message: `Found ${message.length - 1} package${message.length > 2 ? 's have' : ' has'} new version` });
|
||||||
MessageModel.sendNotification('Packages have new version: {0}', message.join('\n'));
|
MessageModel.sendNotification('Packages have new version: {0}', message.join('\n'));
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in new issue
Block a user