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
@@ -80,7 +80,7 @@ export async function add(
doc.parentType = parentType;
doc.parentId = parentId;
}
await bus.serial('document/add', doc);
await bus.parallel('document/add', doc);
const res = await coll.insertOne(doc);
return docId || res.insertedId;
}
@@ -405,7 +405,7 @@ export async function revSetStatus<T extends keyof DocStatusType>(
return res.value;
}
bus.once('app/started', async () => {
bus.on('app/started', async () => {
await db.ensureIndexes(
coll,
{ key: { domainId: 1, docType: 1, docId: 1 }, name: 'basic', unique: true },