func()

in pkg/store/simple_store.go [56:81]


func (s *simpleStore) Load(keys []string) error {
	// ensure that Load is an atomic operation
	s.mutex.Lock()
	defer s.mutex.Unlock()

	for _, key := range keys {
		if _, exists := s.storeItems[key]; exists {
			continue
		}

		itemPath, err := s.getPathToItemAndExistCheck(key)

		if err != nil {
			return err
		}

		// create a storeItem from this, 0 refcount from initial
		newItem := storeItem{
			key:        key,
			refCount:   0,
			pathToItem: itemPath,
		}
		s.storeItems[key] = newItem
	}
	return nil
}