Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:recycle: kernel/model/bazaar: modernize with wg.Go (#17284)

iliya956bf40c6d34
diff --git a/kernel/model/bazaar.go b/kernel/model/bazaar.go
index 61c7e3233c..10479c80c9 100644
--- a/kernel/model/bazaar.go
+++ b/kernel/model/bazaar.go
@@ -114,28 +114,22 @@ func BatchUpdatePackages(frontend string) {
// GetUpdatedPackages 获取所有类型集市包的更新列表
func GetUpdatedPackages(frontend string) (plugins, widgets, icons, themes, templates []*bazaar.Package) {
wg := &sync.WaitGroup{}
- wg.Add(5)
- go func() {
- defer wg.Done()
+ wg.Go(func() {
plugins = getUpdatedPackages("plugins", frontend, "")
- }()
- go func() {
- defer wg.Done()
+ })
+ wg.Go(func() {
themes = getUpdatedPackages("themes", "", "")
- }()
- go func() {
- defer wg.Done()
+ })
+ wg.Go(func() {
icons = getUpdatedPackages("icons", "", "")
- }()
- go func() {
- defer wg.Done()
+ })
+ wg.Go(func() {
templates = getUpdatedPackages("templates", "", "")
- }()
- go func() {
- defer wg.Done()
+ })
+ wg.Go(func() {
widgets = getUpdatedPackages("widgets", "", "")
- }()
+ })
wg.Wait()
return