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

Method LoadSentinel

pkg/models/store.go:242–252  ·  view source on GitHub ↗
(must bool)

Source from the content-addressed store, hash-verified

240}
241
242func (s *Store) LoadSentinel(must bool) (*Sentinel, error) {
243 b, err := s.client.Read(s.SentinelPath(), must)
244 if err != nil || b == nil {
245 return nil, err
246 }
247 p := &Sentinel{}
248 if err := jsonDecode(p, b); err != nil {
249 return nil, err
250 }
251 return p, nil
252}
253
254func (s *Store) UpdateSentinel(p *Sentinel) error {
255 return s.client.Update(s.SentinelPath(), p.Encode())

Callers 1

refillCacheSentinelMethod · 0.80

Calls 3

SentinelPathMethod · 0.95
jsonDecodeFunction · 0.85
ReadMethod · 0.65

Tested by

no test coverage detected