Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
📄 Summary
굉장히 귀여운 PR 등장~ 코드 +5줄~
기존에 아이템 이미지들을 S3에 업로드하다가 예외가 발생하면, 예외가 발생하기 전에 업로드된 이미지들은 S3에 그대로 남아있었습니다.
S3 업로드시 예외가 발생하면
S3ImageEvent
를 발행해, 요청으로 온 모든 이미지들을 S3에서 삭제하게 했습니다. (요청으로 온 이미지들중 업로드가 된 이미지들만 특정해서 지울 수도 있지만, 아이템당 최대 5개의 이미지만 가지기에 그냥 전부 삭제하게 했습니다. S3에 존재하지 않는 이미지를 삭제하는 요청이 간다면 무시되기에 괜찮다고 생각했음)원래 하려고 했던 것...
S3 이미지 삭제를
@Async
를 사용해 비동기로 처리하고 있습니다.@Async
만 붙이면 요청 수만큼 thread를 생성하는SimpleAsyncTaskExecutor
를 쓰는 줄 알고 thread pool size 지정해주려고 했는데, 스프링부트에서는@Async
만 해도ThreadPoolTaskExecutor
를 잘 가져오네요!!!ㅎㅎ (디폴트값인 core pool size 8 적용중)core pool size라도 튜닝할까 했는데, 몇으로 해야할 지 잘 모르겠어요 ㅎㅎ 😥 어떤 걸 기준으로 잡고 thread를 설정해야 할지...............ㅎㅎ 의견이 있으시다면 코멘트로 남겨주십시오
🙋🏻 More