code: func GetAndCacheDeviceProfile(db sqlx.Queryer, p *redis.Pool, id uuid.UUID) (DeviceProfile, error) {
  	dp, err := GetDeviceProfileCache(p, id)
  	if err == nil {
  		return dp, nil
  	}
  
  	if err != ErrDoesNotExist {
  		log.WithFields(log.Fields{
  			"device_profile_id": id,
  		}).WithError(err).Error("get device-profile cache error")
  		// we don't return as we can still fall-back onto db retrieval
  	}
  
  	dp, err = GetDeviceProfile(db, id)
  	if err != nil {
  		return DeviceProfile{}, errors.Wrap(err, "get device-profile error")
  	}
  
  	err = CreateDeviceProfileCache(p, dp)
  	if err != nil {
  		log.WithFields(log.Fields{
  			"device_profile_id": id,
  		}).WithError(err).Error("create device-profile cache error")
  	}
  
  	return dp, nil
  }
docs: // GetAndCacheDeviceProfile returns the device-profile from cache
  // in case available, else it will be retrieved from the database and then
  // stored in cache.