add models task
This commit is contained in:
@@ -10,7 +10,7 @@ import (
|
||||
)
|
||||
|
||||
func (p *Proxy) HandleModels(c *gin.Context) {
|
||||
models, err := p.getCache()
|
||||
models, err := p.getModelCache()
|
||||
if err != nil {
|
||||
dto.Fail(c, http.StatusBadGateway, err.Error())
|
||||
return
|
||||
@@ -25,7 +25,7 @@ func (p *Proxy) HandleModels(c *gin.Context) {
|
||||
dto.Success(c, ms)
|
||||
}
|
||||
|
||||
func (p *Proxy) setCache() error {
|
||||
func (p *Proxy) setModelCache() error {
|
||||
apikeys, err := p.apiKeyDao.FindKeys(nil)
|
||||
models := make(map[string]bool)
|
||||
if err == nil && len(apikeys) > 0 {
|
||||
@@ -52,7 +52,7 @@ func (p *Proxy) setCache() error {
|
||||
return p.cache.Set("models", support_models)
|
||||
}
|
||||
|
||||
func (p *Proxy) getCache() ([]string, error) {
|
||||
func (p *Proxy) getModelCache() ([]string, error) {
|
||||
models, err := p.cache.Get("models")
|
||||
return models.([]string), err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user