추론 실행 영구제외 조건 추가
추론 결과 UID 앞 8자리 추가 종료->완료, 종료->강제종료 상태 변경
This commit is contained in:
@@ -3,15 +3,22 @@ package com.kamco.cd.kamcoback.common.api;
|
||||
import com.kamco.cd.kamcoback.common.api.HelloDto.Res;
|
||||
import com.kamco.cd.kamcoback.common.service.ExternalJarRunner;
|
||||
import com.kamco.cd.kamcoback.common.service.HelloService;
|
||||
import io.swagger.v3.oas.annotations.Hidden;
|
||||
import com.kamco.cd.kamcoback.config.resttemplate.ExternalHttpClient;
|
||||
import com.kamco.cd.kamcoback.config.resttemplate.ExternalHttpClient.ExternalCallResult;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import java.util.List;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@Hidden
|
||||
@Log4j2
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/api/hello")
|
||||
@@ -19,6 +26,7 @@ public class HelloApiController {
|
||||
|
||||
private final HelloService helloService;
|
||||
private final ExternalJarRunner externalJarRunner;
|
||||
private final ExternalHttpClient externalHttpClient;
|
||||
|
||||
@GetMapping
|
||||
public HelloDto.Res hello(HelloDto.Req req) {
|
||||
@@ -40,4 +48,24 @@ public class HelloApiController {
|
||||
String mapIds) {
|
||||
externalJarRunner.run(jarPath, batchIds, inferenceId, mapIds);
|
||||
}
|
||||
|
||||
@GetMapping("/batch/{batchId}")
|
||||
public String batch(@PathVariable String batchId) {
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.setContentType(MediaType.APPLICATION_JSON);
|
||||
headers.setAccept(List.of(MediaType.APPLICATION_JSON));
|
||||
String url = "http://10.100.0.11:8000/batches" + "/" + batchId;
|
||||
ExternalCallResult<String> result =
|
||||
externalHttpClient.call(url, HttpMethod.GET, null, headers, String.class);
|
||||
|
||||
int status = result.statusCode();
|
||||
if (status == 404) {
|
||||
log.info("Batch not found. batchId={}", batchId);
|
||||
return null;
|
||||
}
|
||||
if (status < 200 || status >= 300) {
|
||||
return null;
|
||||
}
|
||||
return result.toString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ import org.springframework.stereotype.Component;
|
||||
@Component
|
||||
public class ExternalJarRunner {
|
||||
|
||||
private static final long TIMEOUT_MINUTES = 30;
|
||||
private static final long TIMEOUT_MINUTES = TimeUnit.DAYS.toMinutes(3);
|
||||
|
||||
/**
|
||||
* shp 파일 생성
|
||||
|
||||
Reference in New Issue
Block a user