This commit is contained in:
Liang Ding 2023-01-19 15:37:35 +08:00
parent 74ef94875b
commit 7401ae845a
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
2 changed files with 8 additions and 4 deletions

View file

@ -353,14 +353,18 @@ func (box *Box) Remove(path string) error {
}
func (box *Box) Unindex() {
task.PrependTask(task.DatabaseIndex, unindex, box.ID)
}
func unindex(boxID string) {
tx, err := sql.BeginTx()
if nil != err {
return
}
sql.RemoveBoxHash(tx, box.ID)
sql.DeleteByBoxTx(tx, box.ID)
sql.RemoveBoxHash(tx, boxID)
sql.DeleteByBoxTx(tx, boxID)
sql.CommitTx(tx)
ids := treenode.RemoveBlockTreesByBoxID(box.ID)
ids := treenode.RemoveBlockTreesByBoxID(boxID)
RemoveRecentDoc(ids)
}

View file

@ -101,7 +101,7 @@ const (
CloudSync = "task.cloud.sync" // 数据同步
RepoCheckout = "task.repo.checkout" // 从快照中检出
DatabaseIndexFull = "task.database.index.full" // 重建索引
DatabaseIndex = "task.database.index" // 数据库所以队列
DatabaseIndex = "task.database.index" // 数据库索引队列
DatabaseIndexFix = "task.database.index.fix" // 数据库索引订正
OCRImage = "task.ocr.image" // 图片 OCR 提取文本
HistoryGenerateDoc = "task.history.generateDoc" // 生成文件历史