mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 07:00:12 +01:00
🎨 降低自动 OCR 时的并发数
This commit is contained in:
parent
8c83ea6a52
commit
9c08bcd958
1 changed files with 2 additions and 2 deletions
|
|
@ -34,8 +34,8 @@ func autoOCRAssets() {
|
||||||
assets := getUnOCRAssetsAbsPaths()
|
assets := getUnOCRAssetsAbsPaths()
|
||||||
if 0 < len(assets) {
|
if 0 < len(assets) {
|
||||||
poolSize := runtime.NumCPU()
|
poolSize := runtime.NumCPU()
|
||||||
if 4 < poolSize {
|
if 2 < poolSize {
|
||||||
poolSize = 4
|
poolSize = 2
|
||||||
}
|
}
|
||||||
waitGroup := &sync.WaitGroup{}
|
waitGroup := &sync.WaitGroup{}
|
||||||
p, _ := ants.NewPoolWithFunc(poolSize, func(arg interface{}) {
|
p, _ := ants.NewPoolWithFunc(poolSize, func(arg interface{}) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue