mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-01 18:30:16 +01:00
♻️ 后台任务队列支持设置超时 Fix https://github.com/siyuan-note/siyuan/issues/7331
This commit is contained in:
parent
a6d945a9a1
commit
5e254500ef
4 changed files with 15 additions and 13 deletions
|
|
@ -209,7 +209,7 @@ func IndexRefs() {
|
|||
// IndexEmbedBlockJob 嵌入块支持搜索 https://github.com/siyuan-note/siyuan/issues/7112
|
||||
func IndexEmbedBlockJob() {
|
||||
embedBlocks := sql.QueryEmptyContentEmbedBlocks()
|
||||
task.AppendTask(task.DatabaseIndexEmbedBlock, autoIndexEmbedBlock, embedBlocks)
|
||||
task.AppendTaskWithTimeout(task.DatabaseIndexEmbedBlock, 30*time.Second, autoIndexEmbedBlock, embedBlocks)
|
||||
}
|
||||
|
||||
func autoIndexEmbedBlock(embedBlocks []*sql.Block) {
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ func OCRAssetsJob() {
|
|||
return
|
||||
}
|
||||
|
||||
task.AppendTask(task.OCRImage, autoOCRAssets)
|
||||
task.AppendTaskWithTimeout(task.OCRImage, 7*time.Second, autoOCRAssets)
|
||||
}
|
||||
|
||||
func autoOCRAssets() {
|
||||
|
|
@ -39,7 +39,7 @@ func autoOCRAssets() {
|
|||
util.AssetsTextsLock.Unlock()
|
||||
util.AssetsTextsChanged = true
|
||||
|
||||
if 16 <= i { // 一次任务中最多处理 16 张图片,防止卡顿
|
||||
if 4 <= i { // 一次任务中最多处理 4 张图片,防止卡顿
|
||||
break
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ func searchEmbedBlock(embedBlockID, stmt string, excludeIDs []string, headingMod
|
|||
}
|
||||
|
||||
// 嵌入块支持搜索 https://github.com/siyuan-note/siyuan/issues/7112
|
||||
task.AppendTask(task.DatabaseIndexEmbedBlock, updateEmbedBlockContent, embedBlockID, ret)
|
||||
task.AppendTaskWithTimeout(task.DatabaseIndexEmbedBlock, 30*time.Second, updateEmbedBlockContent, embedBlockID, ret)
|
||||
|
||||
// 添加笔记本名称
|
||||
var boxIDs []string
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue