MCPcopy
hub / github.com/CodisLabs/codis / refillCacheProxy

Method refillCacheProxy

pkg/topom/topom_cache.go:125–144  ·  view source on GitHub ↗
(proxy map[string]*models.Proxy)

Source from the content-addressed store, hash-verified

123}
124
125func (s *Topom) refillCacheProxy(proxy map[string]*models.Proxy) (map[string]*models.Proxy, error) {
126 if proxy == nil {
127 return s.store.ListProxy()
128 }
129 for t, _ := range proxy {
130 if proxy[t] != nil {
131 continue
132 }
133 p, err := s.store.LoadProxy(t, false)
134 if err != nil {
135 return nil, err
136 }
137 if p != nil {
138 proxy[t] = p
139 } else {
140 delete(proxy, t)
141 }
142 }
143 return proxy, nil
144}
145
146func (s *Topom) refillCacheSentinel(sentinel *models.Sentinel) (*models.Sentinel, error) {
147 if sentinel != nil {

Callers 1

refillCacheMethod · 0.95

Calls 2

ListProxyMethod · 0.80
LoadProxyMethod · 0.80

Tested by

no test coverage detected