환불스케줄러 원복 및 주석 추가

This commit is contained in:
wyh 2024-11-07 15:06:08 +09:00
parent 8afad77998
commit dc23493ed8

View File

@ -91,8 +91,8 @@ public class SchedulerUtil {
/*
* 2분 마다 1주일 데이터에서 환불 대상을 찾아서 환불 한다.
* */
// Schdule Lock (5분동안)
@Scheduled(cron = "0 0/5 * * * ?")
// Schdule Lock (10분동안)
@Scheduled(cron = "0 0/10 * * * ?")
@SchedulerLock(name = "runScenarioOneTime", lockAtMostForString = ONE_MIN, lockAtLeastForString = ONE_MIN)
public void runScenarioOneTime() throws Exception {
@ -485,37 +485,23 @@ public class SchedulerUtil {
//어플리케이션 트랜잭션 문제가 있어 Util 단으로 DB 호출을 가져옴 - 2024-03-14
//schdlrManageService.msgFailPayBack();
// limit 제한 있음
MjonMsgVO mjonMsgVO = new MjonMsgVO();
mjonMsgVO.setRecordCountPerPage(500);
//List<MjonMsgVO> msgFailList = mjonMsgDataDAO.selectMsgSentFailSchedulerList(mjonMsgVO);
// limit 제한 없음
List<MjonMsgVO> msgFailList = mjonMsgDataDAO.selectMsgSentFailList();
long forBeforeTime = System.currentTimeMillis(); // 코드 실행 시간
int batchSize = 300;
int totalSize = msgFailList.size();
int endj =0;
for (int i = 0; i < totalSize; i += batchSize) {
int end = Math.min(i + batchSize, totalSize);
long beforeTime = System.currentTimeMillis(); // 코드 실행 시간
for(int j=endj; j < end; j++) {
System.out.println(j+" : "+ end);
try {
mjonMsgDataDAO.updateMsgSentFailPayBack(msgFailList.get(j));
}catch(Exception ex) {
System.out.println("=============SchedulerUtil=====PayBack Catch =============>");
System.out.println(msgFailList.get(j).getUserId()+" : "+ msgFailList.get(j).getMsgGroupId() +" : "+ msgFailList.get(j).getUserData());
ex.printStackTrace();
}
}
endj = end;
long afterTime = System.currentTimeMillis(); // 코드 실행 시간
long secDiffTime = (afterTime - beforeTime)/1000; // 코드 실행 전후 시간 차이 계산( 단위)
System.out.println("==PayBack for 1 =============> : " + secDiffTime +"");
}
int count = 0;
for(MjonMsgVO vo : msgFailList) {
System.out.println(count + " : "+ msgFailList.size());
try {
mjonMsgDataDAO.updateMsgSentFailPayBack(vo);
}catch(Exception ex) {
System.out.println("=============SchedulerUtil=====PayBack Catch =============>");
System.out.println(vo.getUserId()+" : "+ vo.getMsgGroupId() +" : "+ vo.getUserData());
ex.printStackTrace();
}
count = count + 1;
}
long forAfterTime = System.currentTimeMillis(); // 코드 실행 시간
long forSecDiffTime = (forAfterTime - forBeforeTime)/1000; // 코드 실행 전후 시간 차이 계산( 단위)
System.out.println("==PayBack for 2 =============> 수량 : "+msgFailList.size()+" ===== " + forSecDiffTime +"");