MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / descriptions

Method descriptions

pkg/frequencyplans/frequencyplans.go:625–644  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

623}
624
625func (s *Store) descriptions() (frequencyPlanList, error) {
626 s.descriptionsMu.Lock()
627 defer s.descriptionsMu.Unlock()
628 if s.descriptionsCache != nil {
629 return s.descriptionsCache, nil
630 }
631 if time.Since(s.descriptionsFetchErrorTime) < yamlFetchErrorCache {
632 return nil, s.descriptionsFetchError
633 }
634 descriptions, err := s.fetchDescriptions()
635 if err != nil {
636 s.descriptionsFetchError = err
637 s.descriptionsFetchErrorTime = time.Now()
638 return nil, err
639 }
640 s.descriptionsFetchErrorTime = time.Time{}
641 s.descriptionsFetchError = nil
642 s.descriptionsCache = descriptions
643 return descriptions, nil
644}
645
646var (
647 errNotConfigured = errors.Define("not_configured", "frequency plans not configured")

Callers 3

getByIDMethod · 0.95
GetAllIDsMethod · 0.95
ListFrequencyPlansMethod · 0.80

Calls 2

fetchDescriptionsMethod · 0.95
NowMethod · 0.65

Tested by

no test coverage detected