MCPcopy Create free account
hub / github.com/Quorinex/Kiro-Go / apiRefreshAllAccountsModels

Method apiRefreshAllAccountsModels

proxy/handler.go:678–688  ·  view source on GitHub ↗

apiRefreshAllAccountsModels POST /admin/api/accounts/models/refresh 直接复用 refreshModelsCache,为所有已启用账号刷新模型路由缓存。

(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

676 h.modelsCacheMu.Lock()
677 h.cachedModels = mergeUniqueModels(h.cachedModels, models)
678 h.modelsCacheTime = time.Now().Unix()
679 h.modelsCacheMu.Unlock()
680
681 logger.Infof("[ModelsCache] Refreshed %d models for account %s", len(models), account.Email)
682 return nil
683}
684
685// apiRefreshAccountModels POST /admin/api/accounts/{id}/models/refresh
686// 立即为指定账号拉取并更新模型路由缓存。
687func (h *Handler) apiRefreshAccountModels(w http.ResponseWriter, r *http.Request, id string) {
688 accounts := config.GetAccounts()
689 var account *config.Account
690 for i := range accounts {
691 if accounts[i].ID == id {

Callers 1

handleAdminAPIMethod · 0.95

Calls 1

refreshModelsCacheMethod · 0.95

Tested by

no test coverage detected