core: update hook usage

This commit is contained in:
undefined committed 2022-09-23 20:10:36 +08:00
1 parent ab933bc9d5
commit 757b5e6bc1
27 files changed
+63 -64

No files matched your search

+2 -2
View File
@@ -148,10 +148,10 @@ Worker.addHandler('task.daily', async () => {
if (global.Hydro.model.system.get('server.checkUpdate') && !(new Date().getDay() % 3)) {
await global.Hydro.script.checkUpdate?.run({}, new Logger('task/checkUpdate').debug);
}
await bus.serial('task/daily');
await bus.parallel('task/daily');
});
bus.on('domain/delete', (domainId) => coll.deleteMany({ domainId }));
bus.once('app/started', async () => {
bus.on('app/started', async () => {
if (process.env.NODE_APP_INSTANCE !== '0') return;
if (!await TaskModel.count({ type: 'schedule', subType: 'task.daily' })) {
await TaskModel.add({