khu-khlug / sight-backend

쿠러그의 백엔드 어플리케이션 저장소
1 stars 0 forks source link

feat: 이벤트 핸들러에도 트랜잭션을 적용할 수 있도록 구현 #37

Closed Coalery closed 10 months ago

Coalery commented 10 months ago

주요 변경 사항

이벤트 핸들러에도 @Transactional() 데코레이터를 사용하여 트랜잭션을 적용할 수 있도록 구현합니다.

변경 이유

이벤트 처리가 완전하게 비동기로 처리됨에 따라 트랜잭션의 entity manager를 사용하면 문제가 발생할 수 있습니다.

이에 따라, 이벤트 핸들러에서는 트랜잭션의 entity manager가 아니라 기본 entity manager를 사용하도록 수정합니다.

테스트는 나중에 작성합니다. (너무 딜레이됨)

github-actions[bot] commented 10 months ago

Coverage report

St.:grey_question:
Category Percentage Covered / Total
🔴 Statements
52.32% (-6.6% 🔻)
282/539
🔴 Branches
41.89% (-8.11% 🔻)
31/74
🔴 Functions
28.35% (-6.13% 🔻)
55/194
🔴 Lines
51.28% (-6.28% 🔻)
261/509
Show new covered files 🐣
|
St.:grey_question:
| File | Statements | Branches | Functions | Lines | | :----------------------------------------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------- | :--------- | :------- | :-------- | :---- | | 🔴 |
`...` / TransactionMethodExplorer.ts
| 0% | 0% | 0% | 0% | | 🔴 |
`...` / TransactionalApplier.ts
| 0% | 0% | 0% | 0% |
Show files with reduced coverage 🔻
|
St.:grey_question:
| File | Statements | Branches | Functions | Lines | | :----------------------------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------ | :------------------------------------------------------ | :------------------------------------------------------ | :------------------------------------------------------ | :------------------------------------------------------ | | 🔴 |
`...` / Transactional.ts
|
0% (-100% 🔻)
| 100% |
0% (-100% 🔻)
|
0% (-100% 🔻)
| | 🔴 |
`...` / TransactionModule.ts
| 0% |
0% (-100% 🔻)
| 0% | 0% | | 🔴 |
`...` / constant.ts
|
0% (-100% 🔻)
| 100% | 100% |
0% (-100% 🔻)
|

Test suite run success

26 tests passing in 10 suites.

Report generated by 🧪jest coverage report action from 469135837588001d98d3f5acf6e0ca9eea2af72e