mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 14:40:12 +01:00
🎨 改进内核任务调度机制提升稳定性 https://github.com/siyuan-note/siyuan/issues/7113
This commit is contained in:
parent
e214543c86
commit
81df07598d
1 changed files with 3 additions and 3 deletions
|
|
@ -19,7 +19,7 @@ package treenode
|
||||||
import (
|
import (
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
"runtime/debug"
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
@ -353,7 +353,7 @@ func InitBlockTree(force bool) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
blockTreesLock.Unlock()
|
blockTreesLock.Unlock()
|
||||||
debug.FreeOSMemory()
|
runtime.GC()
|
||||||
|
|
||||||
if elapsed := time.Since(start).Seconds(); 2 < elapsed {
|
if elapsed := time.Since(start).Seconds(); 2 < elapsed {
|
||||||
logging.LogWarnf("read block tree [%s] to [%s], elapsed [%.2fs]", humanize.Bytes(uint64(len(data))), util.BlockTreePath, elapsed)
|
logging.LogWarnf("read block tree [%s] to [%s], elapsed [%.2fs]", humanize.Bytes(uint64(len(data))), util.BlockTreePath, elapsed)
|
||||||
|
|
@ -385,7 +385,7 @@ func SaveBlockTree(force bool) {
|
||||||
os.Exit(util.ExitCodeBlockTreeErr)
|
os.Exit(util.ExitCodeBlockTreeErr)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
debug.FreeOSMemory()
|
runtime.GC()
|
||||||
|
|
||||||
if elapsed := time.Since(start).Seconds(); 2 < elapsed {
|
if elapsed := time.Since(start).Seconds(); 2 < elapsed {
|
||||||
logging.LogWarnf("save block tree [size=%s] to [%s], elapsed [%.2fs]", humanize.Bytes(uint64(len(data))), util.BlockTreePath, elapsed)
|
logging.LogWarnf("save block tree [size=%s] to [%s], elapsed [%.2fs]", humanize.Bytes(uint64(len(data))), util.BlockTreePath, elapsed)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue