mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🎨 桌面端支持搜索图片 OCR 文本 https://github.com/siyuan-note/siyuan/issues/3470
This commit is contained in:
parent
15cd499f56
commit
0e5d2dc87c
1 changed files with 6 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue