// This method saves all received AppleSearchAppInfo objs to redis for caching
This method saves all received AppleSearchAppInfo objs to redis for caching
// This method saves all received AppleSearchAppInfo objs to redis for caching
func saveResultsToCache(results []searchApi.AppleSearchAppInfo) {
	for i := 0; i < len(results); i++ {
		val, err := json.Marshal(results[i])
		if err != nil {
			log.Println("Error in Marshal appInfo for saving to redis, err" + err.Error())
			continue
		}
		err = redisClient.Set("app_info:"+strconv.FormatInt(results[i].IosId, 10),
			string(val),
			time.Duration(REDIS_CACHE_EXPIRE_SECS)*time.Second).Err()
		if err != nil {
			log.Println("Error in Set key to Redis, err" + err.Error())
			continue
		}
	}
}
func saveResultsToCache ( results [ ] searchApi . AppleSearchAppInfo ) { for i := 0 ; i < len ( results ) ; i ++ { val , err := json . Marshal ( results [ i ] ) if err != nil { log . Println ( " " + err . Error ( ) ) continue } err = redisClient . Set ( " " + strconv . FormatInt ( results [ i ] . IosId , 10 ) , string ( val ) , time . Duration ( REDIS_CACHE_EXPIRE_SECS ) * time . Second ) . Err ( ) if err != nil { log . Println ( " " + err . Error ( ) ) continue } } }
This method saves all received AppleSearchAppInfo objs to redis for caching
This method saves all received AppleSearchAppInfo objs to redis for caching