core: storage: use soft copy (#830)

This commit is contained in:
undefined authored and GitHub committed 2024-06-22 23:35:07 +08:00
1 parent 82b73a95e0
commit fc2ac23657
4 files changed
+25 -28

No files matched your search

+2 -1
View File
@@ -262,7 +262,8 @@ export class ProblemModel {
const res = await Promise.all([
document.deleteOne(domainId, document.TYPE_PROBLEM, docId),
document.deleteMultiStatus(domainId, document.TYPE_PROBLEM, { docId }),
storage.list(`problem/${domainId}/${docId}/`).then((items) => storage.del(items.map((item) => item.prefix + item.name))),
storage.list(`problem/${domainId}/${docId}/`)
.then((items) => storage.del(items.map((item) => `problem/${domainId}/${docId}/${item.name}`))),
bus.parallel('problem/delete', domainId, docId),
]);
await bus.emit('problem/del', domainId, docId);