환불스케줄러 원복 및 주석 추가
@dc23493ed8877bcfc1713f8dd30eca41741a599f
--- src/main/java/itn/let/schdlr/service/SchedulerUtil.java
+++ src/main/java/itn/let/schdlr/service/SchedulerUtil.java
... | ... | @@ -91,8 +91,8 @@ |
| 91 | 91 |
/* |
| 92 | 92 |
* 2분 마다 1주일 데이터에서 환불 대상을 찾아서 환불 한다. |
| 93 | 93 |
* */ |
| 94 |
- // Schdule Lock (5분동안) |
|
| 95 |
- @Scheduled(cron = "0 0/5 * * * ?") |
|
| 94 |
+ // Schdule Lock (10분동안) |
|
| 95 |
+ @Scheduled(cron = "0 0/10 * * * ?") |
|
| 96 | 96 |
@SchedulerLock(name = "runScenarioOneTime", lockAtMostForString = ONE_MIN, lockAtLeastForString = ONE_MIN) |
| 97 | 97 |
public void runScenarioOneTime() throws Exception {
|
| 98 | 98 |
|
... | ... | @@ -485,37 +485,23 @@ |
| 485 | 485 |
//어플리케이션 트랜잭션 문제가 있어 Util 단으로 DB 호출을 가져옴 - 2024-03-14 |
| 486 | 486 |
//schdlrManageService.msgFailPayBack(); |
| 487 | 487 |
|
| 488 |
- // limit 제한 있음 |
|
| 489 |
- MjonMsgVO mjonMsgVO = new MjonMsgVO(); |
|
| 490 |
- mjonMsgVO.setRecordCountPerPage(500); |
|
| 491 |
- //List<MjonMsgVO> msgFailList = mjonMsgDataDAO.selectMsgSentFailSchedulerList(mjonMsgVO); |
|
| 492 |
- |
|
| 493 |
- // limit 제한 없음 |
|
| 494 | 488 |
List<MjonMsgVO> msgFailList = mjonMsgDataDAO.selectMsgSentFailList(); |
| 495 | 489 |
|
| 496 | 490 |
long forBeforeTime = System.currentTimeMillis(); // 코드 실행 전 시간 |
| 497 |
- int batchSize = 300; |
|
| 498 |
- int totalSize = msgFailList.size(); |
|
| 499 |
- int endj =0; |
|
| 500 |
- for (int i = 0; i < totalSize; i += batchSize) {
|
|
| 501 |
- int end = Math.min(i + batchSize, totalSize); |
|
| 502 |
- long beforeTime = System.currentTimeMillis(); // 코드 실행 전 시간 |
|
| 503 |
- for(int j=endj; j < end; j++) {
|
|
| 504 |
- System.out.println(j+" : "+ end); |
|
| 505 |
- try {
|
|
| 506 |
- mjonMsgDataDAO.updateMsgSentFailPayBack(msgFailList.get(j)); |
|
| 507 |
- }catch(Exception ex) {
|
|
| 508 |
- System.out.println("=============SchedulerUtil=====PayBack Catch =============>");
|
|
| 509 |
- System.out.println(msgFailList.get(j).getUserId()+" : "+ msgFailList.get(j).getMsgGroupId() +" : "+ msgFailList.get(j).getUserData()); |
|
| 510 |
- ex.printStackTrace(); |
|
| 511 |
- } |
|
| 512 |
- } |
|
| 513 |
- endj = end; |
|
| 514 |
- |
|
| 515 |
- long afterTime = System.currentTimeMillis(); // 코드 실행 후 시간 |
|
| 516 |
- long secDiffTime = (afterTime - beforeTime)/1000; // 코드 실행 전후 시간 차이 계산(초 단위) |
|
| 517 |
- System.out.println("==PayBack for 1 =============> : " + secDiffTime +"초");
|
|
| 518 |
- } |
|
| 491 |
+ int count = 0; |
|
| 492 |
+ for(MjonMsgVO vo : msgFailList) {
|
|
| 493 |
+ System.out.println(count + " : "+ msgFailList.size()); |
|
| 494 |
+ |
|
| 495 |
+ try {
|
|
| 496 |
+ mjonMsgDataDAO.updateMsgSentFailPayBack(vo); |
|
| 497 |
+ }catch(Exception ex) {
|
|
| 498 |
+ System.out.println("=============SchedulerUtil=====PayBack Catch =============>");
|
|
| 499 |
+ System.out.println(vo.getUserId()+" : "+ vo.getMsgGroupId() +" : "+ vo.getUserData()); |
|
| 500 |
+ ex.printStackTrace(); |
|
| 501 |
+ } |
|
| 502 |
+ |
|
| 503 |
+ count = count + 1; |
|
| 504 |
+ } |
|
| 519 | 505 |
long forAfterTime = System.currentTimeMillis(); // 코드 실행 후 시간 |
| 520 | 506 |
long forSecDiffTime = (forAfterTime - forBeforeTime)/1000; // 코드 실행 전후 시간 차이 계산(초 단위) |
| 521 | 507 |
System.out.println("==PayBack for 2 =============> 수량 : "+msgFailList.size()+" ===== " + forSecDiffTime +"초");
|
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?