This commit is contained in:
Daniel 2025-03-08 11:51:35 +08:00
parent 5e88631c1b
commit c1b70e4515
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
5 changed files with 53 additions and 0 deletions

View file

@ -49,7 +49,11 @@ func Plugins(frontend string) (plugins []*Plugin) {
return
}
bazaarIndex := getBazaarIndex()
if 1 > len(bazaarIndex) {
return
}
requestFailed := false
waitGroup := &sync.WaitGroup{}
lock := &sync.Mutex{}
p, _ := ants.NewPoolWithFunc(8, func(arg interface{}) {
@ -65,15 +69,21 @@ func Plugins(frontend string) (plugins []*Plugin) {
return
}
if requestFailed {
return
}
plugin := &Plugin{}
innerU := util.BazaarOSSServer + "/package/" + repoURL + "/plugin.json"
innerResp, innerErr := httpclient.NewBrowserRequest().SetSuccessResult(plugin).Get(innerU)
if nil != innerErr {
logging.LogErrorf("get bazaar package [%s] failed: %s", repoURL, innerErr)
requestFailed = true
return
}
if 200 != innerResp.StatusCode {
logging.LogErrorf("get bazaar package [%s] failed: %d", innerU, innerResp.StatusCode)
requestFailed = true
return
}