修复通知

This commit is contained in:
smallfawn
2025-03-09 21:01:13 +08:00
parent 41bafc3562
commit ca57772d6d
8 changed files with 155 additions and 190 deletions

View File

@@ -127,7 +127,7 @@ class Task extends Public {
})()
.catch((e) => console.log(e))
.finally(() => $.done());
.finally(async () => await $.done());
async function getNotice() {
let options = {
@@ -165,19 +165,14 @@ function Env(t, s) {
async sendMsg() {
this.log("==============📣Center 通知📣==============")
for (let item of this.notifyStr) {
if (Object.prototype.toString.call(item) === '[object Object]') {
item = JSON.stringify(item)
}
if (Object.prototype.toString.call(arg) === '[object Array]') {
if (Object.prototype.toString.call(item) === '[object Object]' || Object.prototype.toString.call(item) === '[object Array]') {
item = JSON.stringify(item)
}
}
let message = this.notifyStr.join(this.logSeparator);
if (this.isNode()) {
await notify.sendNotify(this.name, message);
} else {
}
}
isNode() {
@@ -279,8 +274,8 @@ function Env(t, s) {
wait(t) {
return new Promise((s) => setTimeout(s, t));
}
done(t = {}) {
this.sendMsg();
async done(t = {}) {
await this.sendMsg();
const s = new Date().getTime(),
e = (s - this.startTime) / 1e3;
this.log(