Skip to content

Commit

Permalink
Revert: 8월 4주차 랭킹 수동 반영 롤백
Browse files Browse the repository at this point in the history
  • Loading branch information
emes-g authored Aug 20, 2024
1 parent cf16ea5 commit d6233a5
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/main/java/store/itpick/backend/util/Redis.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,10 @@ public void saveDay() {
public void saveWeek() {
ZSetOperations<String, Object> zSetOperations = redisTemplate.opsForZSet();

// LocalDate mondayOfPreviousWeek = DateUtils.getMondayOfPreviousWeek(); // 지난주 월요일
LocalDate mondayOfPreviousWeek = DateUtils.getMondayOfThisWeek(); // 이번주 월요일
LocalDate mondayOfPreviousWeek = DateUtils.getMondayOfPreviousWeek(); // 지난주 월요일
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyMMdd");
List<List<String>> dayKeyListOfPreviousWeek = new ArrayList<>();
for (int i = 0; i < 2; i++) { // 월, 화만
for (int i = 0; i < 7; i++) {
LocalDate dayOfPreviousWeek = mondayOfPreviousWeek.plusDays(i); // 지난주 월요일부터 일요일까지

// 해당 날짜의 모든 커뮤니티의 키를 담고 있는 리스트
Expand Down Expand Up @@ -98,8 +97,7 @@ public void saveTotalRanking(PeriodType periodType) {
String date = switch (periodType) {
case BY_REAL_TIME -> "not needed";
case BY_DAY -> DateUtils.localDateToString(LocalDate.now());
// case BY_WEEK -> DateUtils.localDateToString(DateUtils.getMondayOfPreviousWeek());
case BY_WEEK -> DateUtils.localDateToString(DateUtils.getMondayOfThisWeek());
case BY_WEEK -> DateUtils.localDateToString(DateUtils.getMondayOfPreviousWeek());
};
String totalKey = makeKey(CommunityType.TOTAL, periodType, date);
redisTemplate.delete(totalKey); // (혹시 존재했을지 모르는) 기존 키 삭제
Expand Down

0 comments on commit d6233a5

Please sign in to comment.