Files
ollama/server/model_caches.go
2026-05-22 17:19:10 +08:00

33 lines
610 B
Go

package server
import "context"
type modelCaches struct {
recommendations *modelRecommendationsCache
show *modelShowCache
modelList *modelListCache
}
func newModelCaches() *modelCaches {
return &modelCaches{
recommendations: newModelRecommendationsCache(),
show: newModelShowCache(),
modelList: newModelListCache(),
}
}
func (c *modelCaches) Start(ctx context.Context) {
if c == nil {
return
}
if c.recommendations != nil {
c.recommendations.Start(ctx)
}
if c.show != nil {
c.show.Start(ctx)
}
if c.modelList != nil {
c.modelList.Start(ctx)
}
}