remove debug messages
This commit is contained in:
parent
090efaf84a
commit
53973e329f
|
@ -45,7 +45,6 @@ func (c *CacheProvider) GetRecipe(ctx context.Context, r_id uint) (models.Recipe
|
|||
cache_data := c.rdb.Get(ctx, fmt.Sprintf("recipe:%d", r_id))
|
||||
if cache_data.Err() != nil {
|
||||
if errors.Is(cache_data.Err(), redis.Nil) {
|
||||
fmt.Println("--- STORAGE ---")
|
||||
// if empty - get from storage
|
||||
recipe, err := c.addRecipe(ctx, r_id)
|
||||
if err != nil {
|
||||
|
@ -55,7 +54,6 @@ func (c *CacheProvider) GetRecipe(ctx context.Context, r_id uint) (models.Recipe
|
|||
}
|
||||
return models.Recipe{}, fmt.Errorf("%s: %w", op, cache_data.Err())
|
||||
}
|
||||
fmt.Println("--- CACHE ---")
|
||||
// decode
|
||||
var recipe models.Recipe
|
||||
err := json.Unmarshal([]byte(cache_data.Val()), &recipe)
|
||||
|
@ -108,7 +106,6 @@ func (c *CacheProvider) GetRecipes(ctx context.Context, offset, limit int) ([]mo
|
|||
cache_data := c.rdb.Get(ctx, key)
|
||||
if cache_data.Err() != nil {
|
||||
if errors.Is(cache_data.Err(), redis.Nil) {
|
||||
fmt.Println("--- STORAGE ---")
|
||||
// get from storage
|
||||
recipes, err := c.addRecipesPage(ctx, offset, limit)
|
||||
if err != nil {
|
||||
|
@ -118,7 +115,6 @@ func (c *CacheProvider) GetRecipes(ctx context.Context, offset, limit int) ([]mo
|
|||
}
|
||||
return nil, fmt.Errorf("%s: %w", op, cache_data.Err())
|
||||
}
|
||||
fmt.Println("--- CACHE ---")
|
||||
// decode
|
||||
var recipes []models.Recipe = make([]models.Recipe, 0, limit)
|
||||
err := json.Unmarshal([]byte(cache_data.Val()), &recipes)
|
||||
|
@ -157,7 +153,6 @@ func (c *CacheProvider) GetRecipesByCategory(ctx context.Context, offset, limit
|
|||
cache_data := c.rdb.Get(ctx, key)
|
||||
if cache_data.Err() != nil {
|
||||
if errors.Is(cache_data.Err(), redis.Nil) {
|
||||
fmt.Println("--- STORAGE ---")
|
||||
// get from storage
|
||||
recipes, err := c.addRecipesByCategory(ctx, offset, limit, category)
|
||||
if err != nil {
|
||||
|
@ -167,7 +162,6 @@ func (c *CacheProvider) GetRecipesByCategory(ctx context.Context, offset, limit
|
|||
}
|
||||
return nil, fmt.Errorf("%s: %w", op, cache_data.Err())
|
||||
}
|
||||
fmt.Println("--- CACHE ---")
|
||||
// decode
|
||||
var recipes []models.Recipe = make([]models.Recipe, 0, limit)
|
||||
err := json.Unmarshal([]byte(cache_data.Val()), &recipes)
|
||||
|
|
Loading…
Reference in New Issue