mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-24 02:20:13 +01:00
🎨 每次 OCR 任务最多处理 64 张图片以防止卡顿
This commit is contained in:
parent
0da0fb6712
commit
2476776c83
1 changed files with 7 additions and 3 deletions
|
|
@ -53,17 +53,21 @@ func autoOCRAssets() {
|
|||
util.AssetsTextsLock.Unlock()
|
||||
util.AssetsTextsChanged = true
|
||||
})
|
||||
for _, assetAbsPath := range assets {
|
||||
for i, assetAbsPath := range assets {
|
||||
waitGroup.Add(1)
|
||||
p.Invoke(assetAbsPath)
|
||||
|
||||
if 63 <= i { // 一次最多处理 64 张图片,防止卡顿
|
||||
break
|
||||
}
|
||||
}
|
||||
waitGroup.Wait()
|
||||
p.Release()
|
||||
|
||||
cleanNotFoundAssetsTexts()
|
||||
cleanNotExistAssetsTexts()
|
||||
}
|
||||
|
||||
func cleanNotFoundAssetsTexts() {
|
||||
func cleanNotExistAssetsTexts() {
|
||||
tmp := util.AssetsTexts
|
||||
|
||||
assetsPath := util.GetDataAssetsAbsPath()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue