🎨 桌面端支持搜索图片 OCR 文本 https://github.com/siyuan-note/siyuan/issues/3470

This commit is contained in:
Liang Ding 2023-01-16 17:25:13 +08:00
parent 15cd499f56
commit 0e5d2dc87c
No known key found for this signature in database
GPG key ID: 136F30F901A2231D

View file

@ -24,6 +24,7 @@ import (
"os/exec"
"path/filepath"
"regexp"
"runtime"
"runtime/debug"
"strings"
"sync"
@ -117,8 +118,12 @@ func autoOCRAssets() {
assetsPath := GetDataAssetsAbsPath()
assets := getUnOCRAssetsAbsPaths()
poolSize := runtime.NumCPU()
if 4 < poolSize {
poolSize = 4
}
waitGroup := &sync.WaitGroup{}
p, _ := ants.NewPoolWithFunc(4, func(arg interface{}) {
p, _ := ants.NewPoolWithFunc(poolSize, func(arg interface{}) {
defer waitGroup.Done()
assetAbsPath := arg.(string)