Commit fb057d1ea341a2e5272a1e1fb2bbc4fda0fefc12
1 parent
7eae5008
.
Showing
2 changed files
with
13 additions
and
2 deletions
Show diff stats
src/main/java/com/batch/service/JobService.java
| ... | ... | @@ -53,6 +53,9 @@ public class JobService { |
| 53 | 53 | |
| 54 | 54 | @Value("${matching.auto.exceptListByComma}") |
| 55 | 55 | String sExceptMatchType; |
| 56 | + | |
| 57 | + @Value("${thread.ai.count}") | |
| 58 | + BigDecimal bdAiAsyncCount; | |
| 56 | 59 | |
| 57 | 60 | @Value("${thread.ai.count.rowmax}") |
| 58 | 61 | BigDecimal bdAiAsyncMaxRowCount; |
| ... | ... | @@ -312,6 +315,7 @@ public class JobService { |
| 312 | 315 | matchingInnerDelingMapper.createUserJob(paramLog); |
| 313 | 316 | |
| 314 | 317 | List<ThreadAiMatching> lThread = new ArrayList<ThreadAiMatching>(); |
| 318 | + BigDecimal bdTotalThread = BigDecimal.ZERO; | |
| 315 | 319 | for(Map curMap : retData) { |
| 316 | 320 | Map<String, Object> curMParams = new HashMap<String, Object>(); |
| 317 | 321 | curMParams.putAll(curMap); |
| ... | ... | @@ -328,10 +332,12 @@ public class JobService { |
| 328 | 332 | sPythonAiTarget |
| 329 | 333 | ); |
| 330 | 334 | threadAiMatching.start(); |
| 335 | + bdTotalThread = bdTotalThread.add(BigDecimal.ONE); | |
| 331 | 336 | |
| 332 | 337 | //전체카운트가 처리가능카운트를 넘어설때 |
| 333 | - if (bdCurrentRowCount.compareTo(bdAiAsyncMaxRowCount) > -1) { | |
| 338 | + if (bdCurrentRowCount.compareTo(bdAiAsyncMaxRowCount) > -1 || bdTotalThread.compareTo(bdAiAsyncCount) > -1) { | |
| 334 | 339 | bdCurrentRowCount = BigDecimal.ZERO; |
| 340 | + bdTotalThread = BigDecimal.ZERO; | |
| 335 | 341 | |
| 336 | 342 | //현재 작업그룹이 종료가 되었는지 체크해서 종료시 카운트 초기화 하고 다음작업을 한다. |
| 337 | 343 | boolean blnStatus = true; |
| ... | ... | @@ -340,8 +346,10 @@ public class JobService { |
| 340 | 346 | do { |
| 341 | 347 | Map<String, Object> mParam = new HashMap<String, Object>(); |
| 342 | 348 | mParam.put("userJobGroup", jobGroupId); |
| 349 | + mParam.put("exceptJobId", sDate); // 메인 User Job Id 제외 | |
| 343 | 350 | List<Map> lmJob = matchingInnerDelingMapper.getUserJobStatus(mParam); |
| 344 | 351 | for (Map curJob : lmJob) { |
| 352 | + blnStatus = true; | |
| 345 | 353 | String ScurStatus = (String) curJob.get("status"); |
| 346 | 354 | if (!"Finished".equalsIgnoreCase(ScurStatus)) { |
| 347 | 355 | blnStatus = false; |
| ... | ... | @@ -350,7 +358,7 @@ public class JobService { |
| 350 | 358 | break; |
| 351 | 359 | } |
| 352 | 360 | } |
| 353 | - } while (!blnStatus && iTotalWait < bdAiAsyncTotalWaitTime.intValue()); //전체 기다리는 시간까지 체크 | |
| 361 | + } while (!blnStatus && iTotalWait < (bdAiAsyncTotalWaitTime.intValue() * 1000)); //전체 기다리는 시간까지 체크 | |
| 354 | 362 | log.info("Next Thread Group Processing"); |
| 355 | 363 | } |
| 356 | 364 | } | ... | ... |
src/main/resources/mybatis/primaryMapper/MatchingInnerDelingMapper.xml
| ... | ... | @@ -659,6 +659,9 @@ |
| 659 | 659 | public.batch_user_job_status |
| 660 | 660 | WHERE |
| 661 | 661 | user_job_group = #{userJobGroup} |
| 662 | + <if test='exceptJobId != null and !exceptJobId.equals("")'> | |
| 663 | + and user_job_id != #{exceptJobId} | |
| 664 | + </if> | |
| 662 | 665 | ORDER BY |
| 663 | 666 | user_job_id ASC |
| 664 | 667 | </select> | ... | ... |