From 95a7ba100dfa313286b03a0276642dc0e39da364 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Thu, 16 Jan 2025 23:03:36 +0800 Subject: [PATCH 1/6] :art: Improve performance for listing doc tree --- kernel/model/file.go | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/kernel/model/file.go b/kernel/model/file.go index 459348cba..87fa70cb7 100644 --- a/kernel/model/file.go +++ b/kernel/model/file.go @@ -230,6 +230,8 @@ type FileInfo struct { isdir bool } +var listDocTreeLock = sync.Map{} + func ListDocTree(boxID, listPath string, sortMode int, flashcard, showHidden bool, maxListCount int) (ret []*File, totals int, err error) { //os.MkdirAll("pprof", 0755) //cpuProfile, _ := os.Create("pprof/cpu_profile_list_doc_tree") @@ -238,6 +240,21 @@ func ListDocTree(boxID, listPath string, sortMode int, flashcard, showHidden boo ret = []*File{} + // 同一个路径条件不允许并发请求,主要是为了性能考虑,并发请求的话会导致缓存穿透 + listLockKey := boxID + listPath + strconv.Itoa(sortMode) + strconv.FormatBool(flashcard) + strconv.FormatBool(showHidden) + strconv.Itoa(maxListCount) + if v, ok := listDocTreeLock.Load(listLockKey); ok { + v.(*sync.Mutex).Lock() + defer v.(*sync.Mutex).Unlock() + } else { + mu := &sync.Mutex{} + mu.Lock() + listDocTreeLock.Store(listLockKey, mu) + defer func() { + mu.Unlock() + listDocTreeLock.Delete(listLockKey) + }() + } + var deck *riff.Deck var deckBlockIDs []string if flashcard { @@ -353,7 +370,7 @@ func ListDocTree(boxID, listPath string, sortMode int, flashcard, showHidden boo } elapsed = time.Now().Sub(start).Milliseconds() if 500 < elapsed { - logging.LogWarnf("build docs [%d] elapsed [%dms]", len(docs), elapsed) + logging.LogWarnf("list doc tree [%s] build docs [%d] elapsed [%dms]", listPath, len(docs), elapsed) } start = time.Now() From afdce4b1c7e53ac6ec79573bb595746af0f5d92f Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Thu, 16 Jan 2025 23:10:51 +0800 Subject: [PATCH 2/6] :art: Improve performance for listing doc tree --- kernel/model/file.go | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/kernel/model/file.go b/kernel/model/file.go index 87fa70cb7..f53459a06 100644 --- a/kernel/model/file.go +++ b/kernel/model/file.go @@ -240,21 +240,6 @@ func ListDocTree(boxID, listPath string, sortMode int, flashcard, showHidden boo ret = []*File{} - // 同一个路径条件不允许并发请求,主要是为了性能考虑,并发请求的话会导致缓存穿透 - listLockKey := boxID + listPath + strconv.Itoa(sortMode) + strconv.FormatBool(flashcard) + strconv.FormatBool(showHidden) + strconv.Itoa(maxListCount) - if v, ok := listDocTreeLock.Load(listLockKey); ok { - v.(*sync.Mutex).Lock() - defer v.(*sync.Mutex).Unlock() - } else { - mu := &sync.Mutex{} - mu.Lock() - listDocTreeLock.Store(listLockKey, mu) - defer func() { - mu.Unlock() - listDocTreeLock.Delete(listLockKey) - }() - } - var deck *riff.Deck var deckBlockIDs []string if flashcard { From 116d8f3e7d82dd3d8e2fdf78c1ffd64353a7afdc Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Fri, 17 Jan 2025 11:33:26 +0800 Subject: [PATCH 3/6] :octocat: Improve issue template --- .github/ISSUE_TEMPLATE/config.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index e5f276960..2452fe4a5 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,8 +1,8 @@ blank_issues_enabled: false contact_links: - name: 🏘️ Marketplace package feature request - url: https://github.com/siyuan-community/ideas + url: https://github.com/siyuan-community/ideas/issues about: Request new features to the community marketplace package developers - - name: 🔀 Twitter - url: https://twitter.com/b3logos - about: Follow @b3logos on Twitter + - name: 🔀 X + url: https://x.com/b3logos + about: Follow @b3logos on X From ee9d035d0e101482cb36bb6b09af5a1a5e03597c Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Fri, 17 Jan 2025 11:57:50 +0800 Subject: [PATCH 4/6] :art: Clean code --- kernel/model/file.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/kernel/model/file.go b/kernel/model/file.go index f53459a06..edfdb1a51 100644 --- a/kernel/model/file.go +++ b/kernel/model/file.go @@ -230,8 +230,6 @@ type FileInfo struct { isdir bool } -var listDocTreeLock = sync.Map{} - func ListDocTree(boxID, listPath string, sortMode int, flashcard, showHidden bool, maxListCount int) (ret []*File, totals int, err error) { //os.MkdirAll("pprof", 0755) //cpuProfile, _ := os.Create("pprof/cpu_profile_list_doc_tree") From 230e6a1520be5283e5ec2181ce927b4b98fa02de Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Fri, 17 Jan 2025 17:17:53 +0800 Subject: [PATCH 5/6] :art: Supports setting keep-alive notification text on Android https://github.com/siyuan-note/siyuan/issues/13815 --- kernel/model/assets.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/kernel/model/assets.go b/kernel/model/assets.go index 75406fef1..834029e2a 100644 --- a/kernel/model/assets.go +++ b/kernel/model/assets.go @@ -830,6 +830,12 @@ func UnusedAssets() (ret []string) { toRemoves = append(toRemoves, asset) continue } + + if strings.HasSuffix(asset, "android-notification-texts.txt") { + // 排除 Android 通知文本 + toRemoves = append(toRemoves, asset) + continue + } } // 排除数据库中引用的资源文件 From c754de0136b7631943d66705a0731f4b6544b72f Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Fri, 17 Jan 2025 17:20:39 +0800 Subject: [PATCH 6/6] :art: Supports setting keep-alive notification text on Android https://github.com/siyuan-note/siyuan/issues/13815 --- .../20210808180117-6v0mkxr/20240113110040-7sgw8kl.sy | 12 ++++++------ .../20210808180117-czj9bvb/20240113102857-c63dmo5.sy | 12 ++++++------ .../20211226090932-5lcq56f/20240113110500-dz2ae4n.sy | 12 ++++++------ .../20240530133126-axarxgx/20240530101000-e6z5okf.sy | 12 ++++++------ 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/app/guide/20210808180117-6v0mkxr/20240113110040-7sgw8kl.sy b/app/guide/20210808180117-6v0mkxr/20240113110040-7sgw8kl.sy index c6b185796..5a6b353aa 100644 --- a/app/guide/20210808180117-6v0mkxr/20240113110040-7sgw8kl.sy +++ b/app/guide/20210808180117-6v0mkxr/20240113110040-7sgw8kl.sy @@ -7,7 +7,7 @@ "id": "20240113110040-7sgw8kl", "title": "Mobile App", "type": "doc", - "updated": "20250114215441" + "updated": "20250117171914" }, "Children": [ { @@ -560,7 +560,7 @@ "HeadingLevel": 2, "Properties": { "id": "20250114215310-k9lnjrc", - "updated": "20250114215441" + "updated": "20250117171914" }, "Children": [ { @@ -605,7 +605,7 @@ }, "Properties": { "id": "20250114215310-h1tgrnv", - "updated": "20250114215441" + "updated": "20250117171914" }, "Children": [ { @@ -619,7 +619,7 @@ }, "Properties": { "id": "20250114215310-uhglsyt", - "updated": "20250114215441" + "updated": "20250117171914" }, "Children": [ { @@ -627,7 +627,7 @@ "Type": "NodeParagraph", "Properties": { "id": "20250114215310-z7geibq", - "updated": "20250114215441" + "updated": "20250117171914" }, "Children": [ { @@ -646,7 +646,7 @@ { "Type": "NodeTextMark", "TextMarkType": "code", - "TextMarkTextContent": "workspace/assets/" + "TextMarkTextContent": "workspace/data/assets/" }, { "Type": "NodeText", diff --git a/app/guide/20210808180117-czj9bvb/20240113102857-c63dmo5.sy b/app/guide/20210808180117-czj9bvb/20240113102857-c63dmo5.sy index dee05a873..5f6e62838 100644 --- a/app/guide/20210808180117-czj9bvb/20240113102857-c63dmo5.sy +++ b/app/guide/20210808180117-czj9bvb/20240113102857-c63dmo5.sy @@ -7,7 +7,7 @@ "id": "20240113102857-c63dmo5", "title": "移动端 App", "type": "doc", - "updated": "20250114215433" + "updated": "20250117171835" }, "Children": [ { @@ -559,7 +559,7 @@ "HeadingLevel": 2, "Properties": { "id": "20250114214413-n2v7z20", - "updated": "20250114215433" + "updated": "20250117171835" }, "Children": [ { @@ -604,7 +604,7 @@ }, "Properties": { "id": "20250114215159-d40seb3", - "updated": "20250114215433" + "updated": "20250117171835" }, "Children": [ { @@ -618,7 +618,7 @@ }, "Properties": { "id": "20250114215201-degei8s", - "updated": "20250114215433" + "updated": "20250117171835" }, "Children": [ { @@ -626,7 +626,7 @@ "Type": "NodeParagraph", "Properties": { "id": "20250114215201-ffgvnm6", - "updated": "20250114215433" + "updated": "20250117171835" }, "Children": [ { @@ -636,7 +636,7 @@ { "Type": "NodeTextMark", "TextMarkType": "code", - "TextMarkTextContent": "工作空间/assets/" + "TextMarkTextContent": "工作空间/data/assets/" }, { "Type": "NodeText", diff --git a/app/guide/20211226090932-5lcq56f/20240113110500-dz2ae4n.sy b/app/guide/20211226090932-5lcq56f/20240113110500-dz2ae4n.sy index 0058d7ffe..9a65f5c66 100644 --- a/app/guide/20211226090932-5lcq56f/20240113110500-dz2ae4n.sy +++ b/app/guide/20211226090932-5lcq56f/20240113110500-dz2ae4n.sy @@ -7,7 +7,7 @@ "id": "20240113110500-dz2ae4n", "title": "行動端 App", "type": "doc", - "updated": "20250114215523" + "updated": "20250117171906" }, "Children": [ { @@ -560,7 +560,7 @@ "HeadingLevel": 2, "Properties": { "id": "20250114215505-lg1uhjx", - "updated": "20250114215523" + "updated": "20250117171906" }, "Children": [ { @@ -605,7 +605,7 @@ }, "Properties": { "id": "20250114215505-0k51ynd", - "updated": "20250114215523" + "updated": "20250117171906" }, "Children": [ { @@ -619,7 +619,7 @@ }, "Properties": { "id": "20250114215505-kgwvae6", - "updated": "20250114215505" + "updated": "20250117171906" }, "Children": [ { @@ -627,7 +627,7 @@ "Type": "NodeParagraph", "Properties": { "id": "20250114215505-cayyq7g", - "updated": "20250114215505" + "updated": "20250117171906" }, "Children": [ { @@ -637,7 +637,7 @@ { "Type": "NodeTextMark", "TextMarkType": "code", - "TextMarkTextContent": "工作空間/assets/" + "TextMarkTextContent": "工作空間/data/assets/" }, { "Type": "NodeText", diff --git a/app/guide/20240530133126-axarxgx/20240530101000-e6z5okf.sy b/app/guide/20240530133126-axarxgx/20240530101000-e6z5okf.sy index 980bf2be0..705bb167c 100644 --- a/app/guide/20240530133126-axarxgx/20240530101000-e6z5okf.sy +++ b/app/guide/20240530133126-axarxgx/20240530101000-e6z5okf.sy @@ -8,7 +8,7 @@ "id": "20240530101000-e6z5okf", "title": "モバイルアプリ", "type": "doc", - "updated": "20250114215620" + "updated": "20250117171922" }, "Children": [ { @@ -286,7 +286,7 @@ "HeadingLevel": 2, "Properties": { "id": "20250114215535-x0zo9js", - "updated": "20250114215620" + "updated": "20250117171922" }, "Children": [ { @@ -331,7 +331,7 @@ }, "Properties": { "id": "20250114215535-5igrtp8", - "updated": "20250114215612" + "updated": "20250117171922" }, "Children": [ { @@ -345,7 +345,7 @@ }, "Properties": { "id": "20250114215535-a0e9b4c", - "updated": "20250114215612" + "updated": "20250117171922" }, "Children": [ { @@ -353,7 +353,7 @@ "Type": "NodeParagraph", "Properties": { "id": "20250114215535-2lxc7ib", - "updated": "20250114215612" + "updated": "20250117171922" }, "Children": [ { @@ -363,7 +363,7 @@ { "Type": "NodeTextMark", "TextMarkType": "code", - "TextMarkTextContent": "workspace/assets/" + "TextMarkTextContent": "workspace/data/assets/" }, { "Type": "NodeText",