Skip to content

Commit

Permalink
Merge pull request #21 from soodgarak/Feat/get-recipe-list
Browse files Browse the repository at this point in the history
Fix: Redis 초기화 기능 수정
  • Loading branch information
ratcomp9992 authored Aug 29, 2024
2 parents c268dba + 44e5a3f commit 14cc18a
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,15 @@ public class RecipeService {
private final RecipeRedis recipeRedis;
private final CategoryRecipeRedis categoryRecipeRedis;
private final SearchRecipeRedis searchRecipeRedis;
private final Long initCheckValue = 0L;
private final Long countCheckValue = -1L;

private void initRedis(RecipeGroup group) {
if (group.equals(RecipeGroup.ALL) && recipeRedis.existsById(initCheckValue)) {
if (group.equals(RecipeGroup.ALL)) {
recipeRedis.deleteAll();
recipeRedis.save(RedisRecipe.of(initCheckValue, initCheckValue));
} else if (group.equals(RecipeGroup.CATEGORY) && categoryRecipeRedis.existsById(initCheckValue)) {
} else if (group.equals(RecipeGroup.CATEGORY)) {
categoryRecipeRedis.deleteAll();
categoryRecipeRedis.save(RedisCategoryRecipe.of(initCheckValue, initCheckValue));
} else if (group.equals(RecipeGroup.SEARCH) && searchRecipeRedis.existsById(initCheckValue)) {
} else if (group.equals(RecipeGroup.SEARCH)) {
searchRecipeRedis.deleteAll();
searchRecipeRedis.save(RedisSearchRecipe.of(initCheckValue, initCheckValue));
}
}

Expand Down

0 comments on commit 14cc18a

Please sign in to comment.