mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-21 11:30:42 +08:00
This commit is contained in:
parent
2cb6e82330
commit
ffed021dda
@ -57,7 +57,7 @@ func autoOCRAssets() {
|
|||||||
waitGroup.Add(1)
|
waitGroup.Add(1)
|
||||||
p.Invoke(assetAbsPath)
|
p.Invoke(assetAbsPath)
|
||||||
|
|
||||||
if 63 <= i { // 一次最多处理 64 张图片,防止卡顿
|
if 63 <= i { // 一次任务中最多处理 64 张图片,防止卡顿
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1225,8 +1225,8 @@ func AutoIndexEmbedBlock() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func autoIndexEmbedBlock() {
|
func autoIndexEmbedBlock() {
|
||||||
embedBlocks := sql.QueryEmbedBlocks()
|
embedBlocks := sql.QueryEmptyContentEmbedBlocks()
|
||||||
for _, embedBlock := range embedBlocks {
|
for i, embedBlock := range embedBlocks {
|
||||||
stmt := strings.TrimPrefix(embedBlock.Markdown, "{{")
|
stmt := strings.TrimPrefix(embedBlock.Markdown, "{{")
|
||||||
stmt = strings.TrimSuffix(stmt, "}}")
|
stmt = strings.TrimSuffix(stmt, "}}")
|
||||||
blocks := sql.SelectBlocksRawStmtNoParse(stmt, 102400)
|
blocks := sql.SelectBlocksRawStmtNoParse(stmt, 102400)
|
||||||
@ -1234,6 +1234,10 @@ func autoIndexEmbedBlock() {
|
|||||||
embedBlock.Content = block.Content
|
embedBlock.Content = block.Content
|
||||||
sql.UpdateBlockContent(embedBlock)
|
sql.UpdateBlockContent(embedBlock)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if 63 <= i { // 一次任务中最多处理 64 个嵌入块,防止卡顿
|
||||||
|
break
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ import (
|
|||||||
"github.com/siyuan-note/siyuan/kernel/util"
|
"github.com/siyuan-note/siyuan/kernel/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
func QueryEmbedBlocks() (ret []*Block) {
|
func QueryEmptyContentEmbedBlocks() (ret []*Block) {
|
||||||
stmt := "SELECT * FROM blocks WHERE type = 'query_embed' AND content = ''"
|
stmt := "SELECT * FROM blocks WHERE type = 'query_embed' AND content = ''"
|
||||||
rows, err := query(stmt)
|
rows, err := query(stmt)
|
||||||
if nil != err {
|
if nil != err {
|
||||||
|
Loading…
Reference in New Issue
Block a user