mirror of
https://github.com/whyour/qinglong.git
synced 2026-10-01 05:13:50 +08:00
fix: reduce task startup overhead and lazy-load notifications
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user