fix: reduce task startup overhead and lazy-load notifications

This commit is contained in:
whyour
2026-09-28 09:42:54 +08:00
parent f168efcdae
commit 7603702eca
7 changed files with 277 additions and 8 deletions
+6 -2
View File
@@ -159,9 +159,13 @@ try {
run();
const { sendNotify } = require('./__ql_notify__.js');
global.QLAPI = {
notify: sendNotify,
notify(...args) {
// Keep notification dependencies out of ordinary script startup.
// require caches the module after the first notification.
const { sendNotify } = require('./__ql_notify__.js');
return sendNotify.apply(this, args);
},
...client,
};
} catch (error) {