mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 23:20:13 +01:00
⚡ 改进书签面板加载速度 https://github.com/siyuan-note/siyuan/issues/6677
This commit is contained in:
parent
31be236557
commit
8652c4cef7
2 changed files with 7 additions and 1 deletions
|
|
@ -160,7 +160,9 @@ func BookmarkLabels() (ret []string) {
|
||||||
|
|
||||||
func BuildBookmark() (ret *Bookmarks) {
|
func BuildBookmark() (ret *Bookmarks) {
|
||||||
WaitForWritingFiles()
|
WaitForWritingFiles()
|
||||||
sql.WaitForWritingDatabase()
|
if !sql.IsEmptyQueue() {
|
||||||
|
sql.WaitForWritingDatabase()
|
||||||
|
}
|
||||||
|
|
||||||
ret = &Bookmarks{}
|
ret = &Bookmarks{}
|
||||||
sqlBlocks := sql.QueryBookmarkBlocks()
|
sqlBlocks := sql.QueryBookmarkBlocks()
|
||||||
|
|
|
||||||
|
|
@ -81,6 +81,10 @@ func isWritingDatabase() bool {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func IsEmptyQueue() bool {
|
||||||
|
return 1 > len(operationQueue) && !util.IsMutexLocked(&txLock)
|
||||||
|
}
|
||||||
|
|
||||||
func flushTreeQueue() {
|
func flushTreeQueue() {
|
||||||
ops := mergeUpsertTrees()
|
ops := mergeUpsertTrees()
|
||||||
if 1 > len(ops) {
|
if 1 > len(ops) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue