From 00d015aeadb508fb59ac52cc01ca565a22c05748 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Thu, 21 Mar 2024 10:44:34 +0800 Subject: [PATCH] :art: One-click upgrade of downloaded marketplace packages https://github.com/siyuan-note/siyuan/issues/8390 --- kernel/model/bazzar.go | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/kernel/model/bazzar.go b/kernel/model/bazzar.go index a01c3a36e..f53e42e4f 100644 --- a/kernel/model/bazzar.go +++ b/kernel/model/bazzar.go @@ -22,6 +22,7 @@ import ( "path" "path/filepath" "strings" + "sync" "github.com/88250/gulu" "github.com/siyuan-note/siyuan/kernel/util" @@ -30,11 +31,34 @@ import ( ) func BazaarPackages(frontend string) (plugins []*bazaar.Plugin, widgets []*bazaar.Widget, icons []*bazaar.Icon, themes []*bazaar.Theme, templates []*bazaar.Template) { - plugins = BazaarPlugins(frontend, "") - widgets = BazaarWidgets("") - icons = BazaarIcons("") - themes = BazaarThemes("") - templates = BazaarTemplates("") + wg := &sync.WaitGroup{} + wg.Add(5) + go func() { + defer wg.Done() + plugins = InstalledPlugins(frontend, "") + }() + + go func() { + defer wg.Done() + widgets = InstalledWidgets("") + }() + + go func() { + defer wg.Done() + icons = InstalledIcons("") + }() + + go func() { + defer wg.Done() + themes = InstalledThemes("") + }() + + go func() { + defer wg.Done() + templates = InstalledTemplates("") + }() + + wg.Wait() return }