Skip to content

feat : 가게 대표 이미지 스케줄링#271

Open
kchaeeun wants to merge 9 commits into
gusto-umc:developfrom
kchaeeun:feat/storeImage-scheduling
Open

feat : 가게 대표 이미지 스케줄링#271
kchaeeun wants to merge 9 commits into
gusto-umc:developfrom
kchaeeun:feat/storeImage-scheduling

Conversation

@kchaeeun

@kchaeeun kchaeeun commented May 25, 2024

Copy link
Copy Markdown
Collaborator

무엇을 위한 PR인가요?(: 뒤 설명추가)

  • 신규 기능 추가 : 가게 대표 이미지를 스케줄링을 사용해 월요일마다 업데이트될 수 있도록 구현
  • 버그 수정 :
  • 리펙토링 :
  • 문서 업데이트 :
  • 기타 :

변경사항 및 이유

  • 가게 대표 이미지를 API를 불러올 때마다 좋아요가 많은 리뷰의 이미지를 반복해서 가져오는 것은 비효율적이라 여겨, 매주 일요일 자정마다 대표 이미지를 업데이트하기로 변경

작업 내역

  • @scheduled를 사용해 월요일마다 가게 대표이미지가 업데이트될 수 있도록 작업
  • 스케줄링 시 4개의 이미지를 저장하고, 3개의 이미지가 필요한 경우 리스트 슬라이싱 작

작업 후 기대 동작(스크린샷)

  • 카테고리 별 가게 목록 조회
    스크린샷 2024-05-25 174200
  • 가게 조회
    스크린샷 2024-05-25 174555
  • 가게 상세 조회
    스크린샷 2024-05-25 174618

PR 특이 사항

  • 캐시에 저장해서 엔티티에 저장하는 작업을 최소화하려고 했으나 서버 비용이 늘어날 거 같아, 엔티티를 새롭게 구현했습니다.
  • 4개의 이미지를 받아되는 경우가 있어 스케줄링 시 4개의 이미지를 reviewImages 엔티티에 저장하고, 리스트 슬라이싱으로 3개의 이미지 필요한 경우는 3개의 이미지만 조회할 수 있도록 구현했습니다.

Issue Number

close: #270

@kchaeeun kchaeeun added the ✨ Feature New feature or request label May 25, 2024
@kchaeeun kchaeeun self-assigned this May 25, 2024

@yujiyea yujiyea left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

좋습니다!!!

@zzo3ozz zzo3ozz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

정말 수고하셨습니다!! 👍
스케줄 이벤트 발생 시점 관련해서 확인해주시면 좋을 것 같습니다!

이제보니 이전 sign-out PR이 develop 브랜치가 아니라 main 브랜치에 병합이 됐었네요 😢 지금까지 별 일이 없어서 다행이에요~!

Comment thread gusto/src/main/java/com/umc/gusto/domain/review/entity/ReviewImages.java Outdated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

새삼 storeAll 을 보니 서버 부하가 염려스럽네요...!
아무래도 Transcational을 전체 스토어에 걸기에는 가게 양이 너무 많을 것 같아,
차후에 동 별로 끊어서 transactional 처리를 진행하거나 하는 리팩토링이 필요해보입니다!

우선은 스케쥴을 매월 1일, 16일에 진행하도록 변경부탁드려도 될까요?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

넵 알겠습니다

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

엇 새로 커밋하다보니 머지 오류가 생겨서 sign-out 부분이 병합되었는데 큰 문제는 없나요?

@Jeonghee-Han Jeonghee-Han left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고하셨습니다!

@kchaeeun kchaeeun closed this Jul 9, 2024
@kchaeeun kchaeeun reopened this Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ Feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants