Browse Source

:art: 改进内核任务调度机制提升稳定性 https://github.com/siyuan-note/siyuan/issues/7113

Liang Ding 2 years ago
parent
commit
b1cccc1639
2 changed files with 9 additions and 1 deletions
  1. 1 1
      app/appearance/langs/zh_CN.json
  2. 8 0
      kernel/sql/database.go

+ 1 - 1
app/appearance/langs/zh_CN.json

@@ -980,7 +980,7 @@
     "90": "[%d/%d] 已经建立 [%d] 个块级元素的搜索索引 [%s]",
     "90": "[%d/%d] 已经建立 [%d] 个块级元素的搜索索引 [%s]",
     "91": "正在读取块树数据...",
     "91": "正在读取块树数据...",
     "92": "正在解析文档树 [%s]",
     "92": "正在解析文档树 [%s]",
-    "93": "[%d/%d] 已经删除文档 [%s] 相关的索引",
+    "93": "[%d/%d] 已经清理文档 [%s] 相关的索引",
     "94": "上传失败:%s",
     "94": "上传失败:%s",
     "95": "正在退出...",
     "95": "正在退出...",
     "96": "退出时同步失败,请手动执行一次同步以确保本地数据和云端数据一致",
     "96": "退出时同步失败,请手动执行一次同步以确保本地数据和云端数据一致",

+ 8 - 0
kernel/sql/database.go

@@ -953,6 +953,14 @@ func deleteByRootID(tx *sql.Tx, rootID string, context map[string]interface{}) (
 	if err = execStmtTx(tx, stmt, rootID); nil != err {
 	if err = execStmtTx(tx, stmt, rootID); nil != err {
 		return
 		return
 	}
 	}
+	stmt = "DELETE FROM blocks_fts WHERE root_id = ?"
+	if err = execStmtTx(tx, stmt, rootID); nil != err {
+		return
+	}
+	stmt = "DELETE FROM blocks_fts_case_insensitive WHERE root_id = ?"
+	if err = execStmtTx(tx, stmt, rootID); nil != err {
+		return
+	}
 	stmt = "DELETE FROM spans WHERE root_id = ?"
 	stmt = "DELETE FROM spans WHERE root_id = ?"
 	if err = execStmtTx(tx, stmt, rootID); nil != err {
 	if err = execStmtTx(tx, stmt, rootID); nil != err {
 		return
 		return