🎨 改进内核任务调度机制提升稳定性 https://github.com/siyuan-note/siyuan/issues/7113

This commit is contained in:
Liang Ding 2023-01-26 01:33:21 +08:00
parent 373f6b16e2
commit 430bf34dfb
No known key found for this signature in database
GPG key ID: 136F30F901A2231D

View file

@ -21,6 +21,7 @@ import (
"errors"
"fmt"
"path"
"runtime"
"sync"
"time"
@ -125,6 +126,10 @@ func FlushQueue() {
logging.LogErrorf("commit tx failed: %s", err)
return
}
if 16 < i && 0 == i%256 {
runtime.GC()
}
}
elapsed := time.Now().Sub(start).Milliseconds()