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

Method refillCacheGroup

pkg/topom/topom_cache.go:104–123  ·  view source on GitHub ↗
(group map[int]*models.Group)

Source from the content-addressed store, hash-verified

102}
103
104func (s *Topom) refillCacheGroup(group map[int]*models.Group) (map[int]*models.Group, error) {
105 if group == nil {
106 return s.store.ListGroup()
107 }
108 for i, _ := range group {
109 if group[i] != nil {
110 continue
111 }
112 g, err := s.store.LoadGroup(i, false)
113 if err != nil {
114 return nil, err
115 }
116 if g != nil {
117 group[i] = g
118 } else {
119 delete(group, i)
120 }
121 }
122 return group, nil
123}
124
125func (s *Topom) refillCacheProxy(proxy map[string]*models.Proxy) (map[string]*models.Proxy, error) {
126 if proxy == nil {

Callers 1

refillCacheMethod · 0.95

Calls 2

ListGroupMethod · 0.80
LoadGroupMethod · 0.80

Tested by

no test coverage detected