Report 기능 개선
This commit is contained in:
parent
3d1f4a9307
commit
fda519db46
@ -73,32 +73,44 @@ public class ReportQueueTask implements Runnable {
|
|||||||
public void run() {
|
public void run() {
|
||||||
/* 정상적인 Report Queue 저장로직을 수행할 경우 */
|
/* 정상적인 Report Queue 저장로직을 수행할 경우 */
|
||||||
int cntReport = 0;
|
int cntReport = 0;
|
||||||
if (isProcessRun) {
|
while (isProcessRun) {
|
||||||
|
/* 리포트큐가 max에 도달한 경우 */
|
||||||
|
if (reportQueue.isWriteLimit(reportUserDto.getMaxQueueCount())) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* DB : 리포트 데이터 조회 */
|
||||||
ReportService reportService = (ReportService) CacheService.REPORT_SERVICE.getService();
|
ReportService reportService = (ReportService) CacheService.REPORT_SERVICE.getService();
|
||||||
List<ReportDto> list = reportService.getReportListForUser(reportUserDto.getUserId());
|
List<ReportDto> list = reportService.getReportListForUser(reportUserDto.getUserId());
|
||||||
|
|
||||||
/* Report Queue 저장 & DB 데이터 삭제 */
|
/* 리포트 처리를 할 대상이 없는 경우 */
|
||||||
if (list != null && list.size() > 0) {
|
if (list == null || list.isEmpty()) {
|
||||||
List<String> msgList = new ArrayList<>();
|
break;
|
||||||
/* Report Queue에 저장 */
|
}
|
||||||
for (ReportDto dto : list) {
|
|
||||||
boolean isError = false;
|
|
||||||
try {
|
|
||||||
reportQueue.pushReportToQueue(dto);
|
|
||||||
msgList.add(dto.getMsgId());
|
|
||||||
cntReport++; // Report를 처리한 카운트
|
|
||||||
saveLog("reportDto : " + dto.toString());
|
|
||||||
} catch (Exception e) {
|
|
||||||
saveLog("ReportQueueTask ERROR");
|
|
||||||
saveLog(e);
|
|
||||||
isError = true;
|
|
||||||
}
|
|
||||||
/* 에러인 경우 */
|
|
||||||
if (isError) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/* 리포트 큐에 저장 */
|
||||||
|
boolean isError = false;
|
||||||
|
List<String> msgList = new ArrayList<>();
|
||||||
|
/* Report Queue에 저장 */
|
||||||
|
for (ReportDto dto : list) {
|
||||||
|
try {
|
||||||
|
reportQueue.pushReportToQueue(dto);
|
||||||
|
msgList.add(dto.getMsgId());
|
||||||
|
cntReport++; // Report를 처리한 카운트
|
||||||
|
saveLog("reportDto : " + dto.toString());
|
||||||
|
} catch (Exception e) {
|
||||||
|
saveLog("ReportQueueTask ERROR");
|
||||||
|
saveLog(e);
|
||||||
|
isError = true;
|
||||||
|
}
|
||||||
|
/* 에러인 경우 */
|
||||||
|
if (isError) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Report DB 데이터 삭제 */
|
||||||
|
try {
|
||||||
/* DB에서 데이터 삭제 */
|
/* DB에서 데이터 삭제 */
|
||||||
if (msgList.size() > 0) {
|
if (msgList.size() > 0) {
|
||||||
Map<String, Object> reqMap = new HashMap<>();
|
Map<String, Object> reqMap = new HashMap<>();
|
||||||
@ -106,6 +118,14 @@ public class ReportQueueTask implements Runnable {
|
|||||||
reqMap.put("msgList", msgList);
|
reqMap.put("msgList", msgList);
|
||||||
reportService.deleteBulkReport(reqMap);
|
reportService.deleteBulkReport(reqMap);
|
||||||
}
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
saveLog("ReportQueueTask SQL ERROR");
|
||||||
|
saveLog(e);
|
||||||
|
isError = true;
|
||||||
|
}
|
||||||
|
/* 에러인 경우 */
|
||||||
|
if (isError) {
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user