[KC-99] 추론관리 등록 수정, 모델 조회 추가
This commit is contained in:
@@ -61,13 +61,13 @@ public class InferenceResultService {
|
||||
|
||||
// TODO tif 없으면 전년도 파일 조회 쿼리 추가해야함
|
||||
// TODO 도엽 개수를 target 기준으로 맞춰야함
|
||||
this.getSceneInference(String.valueOf(req.getCompareYyyy()), req.getMapSheetNum());
|
||||
this.getSceneInference(String.valueOf(req.getTargetYyyy()), req.getMapSheetNum());
|
||||
|
||||
InferenceSendDto m1 = this.getModelInfo(req.getModel1Uuid());
|
||||
InferenceSendDto m2 = this.getModelInfo(req.getModel2Uuid());
|
||||
InferenceSendDto m3 = this.getModelInfo(req.getModel3Uuid());
|
||||
|
||||
// this.getSceneInference(String.valueOf(req.getCompareYyyy()), req.getMapSheetNum());
|
||||
// this.getSceneInference(String.valueOf(req.getTargetYyyy()), req.getMapSheetNum());
|
||||
//
|
||||
// InferenceSendDto m1 = this.getModelInfo(req.getModel1Uuid());
|
||||
// InferenceSendDto m2 = this.getModelInfo(req.getModel2Uuid());
|
||||
// InferenceSendDto m3 = this.getModelInfo(req.getModel3Uuid());
|
||||
//
|
||||
// ensureAccepted(m1);
|
||||
// ensureAccepted(m2);
|
||||
// ensureAccepted(m3);
|
||||
@@ -93,16 +93,20 @@ public class InferenceResultService {
|
||||
.onErrorReturn(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* api 호출 실패시 예외처리
|
||||
*
|
||||
* @param dto
|
||||
*/
|
||||
private void ensureAccepted(InferenceSendDto dto) {
|
||||
|
||||
Boolean ok =
|
||||
this.inferenceSend(dto)
|
||||
.timeout(java.time.Duration.ofSeconds(3)) // 접수는 빨리 와야 함
|
||||
.timeout(java.time.Duration.ofSeconds(3))
|
||||
.onErrorReturn(false) // 타임아웃/통신오류도 실패 처리
|
||||
.block(java.time.Duration.ofSeconds(4)); // 최종 안전장치 (짧게!)
|
||||
.block(java.time.Duration.ofSeconds(4));
|
||||
|
||||
if (!Boolean.TRUE.equals(ok)) {
|
||||
// 여기서 예외가 터져야 @Transactional 롤백됨
|
||||
throw new CustomApiException("BAD_GATEWAY", HttpStatus.BAD_GATEWAY);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user