Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
40e448fe95 | ||
|
|
8a21646031 |
@@ -6,6 +6,15 @@
|
|||||||
|
|
||||||
## 2026-06-15
|
## 2026-06-15
|
||||||
|
|
||||||
|
### 🐛 WebSearchService HTTP timeout 추가 (v0.1.49)
|
||||||
|
- 벌크 백필 중 특정 검색에서 무한 hang → backend executor virtual thread 점유로 후속 작업 중단 (90건 처리 후 멈춤)
|
||||||
|
- connectTimeout=5s + request timeout=15s (Naver/DDG 둘 다)
|
||||||
|
- 해당 식당은 HttpTimeoutException → notfound로 안전 처리
|
||||||
|
|
||||||
|
### ⏱️ bulk-tabling/catchtable SSE timeout 10분 → 3시간 (v0.1.48)
|
||||||
|
- 대량 백필(724건 ≈ 100분) 시 10분 SSE timeout으로 중간 끊김 → 3시간으로 확장
|
||||||
|
- 백엔드 작업은 virtual thread로 별도 진행됐지만 emit() 예외로 마지막 cache.flush + complete 누락이슈 해소
|
||||||
|
|
||||||
### 🐛 #357 후속 — tabling-url validation에 www. 호스트 허용 (v0.1.47)
|
### 🐛 #357 후속 — tabling-url validation에 www. 호스트 허용 (v0.1.47)
|
||||||
- Naver/DDG 결과가 `https://www.tabling.co.kr/...` 형태인데 #290 validation은 `tabling.co.kr/`만 허용 → 단건 매핑 PUT 거부
|
- Naver/DDG 결과가 `https://www.tabling.co.kr/...` 형태인데 #290 validation은 `tabling.co.kr/`만 허용 → 단건 매핑 PUT 거부
|
||||||
- bulk-tabling SSE는 validation 없이 service.update 직접 호출이라 통과 → 단일/벌크 불일치
|
- bulk-tabling SSE는 validation 없이 service.update 직접 호출이라 통과 → 단일/벌크 불일치
|
||||||
|
|||||||
@@ -175,7 +175,7 @@ public class RestaurantController {
|
|||||||
@PostMapping("/bulk-tabling")
|
@PostMapping("/bulk-tabling")
|
||||||
public SseEmitter bulkTabling() {
|
public SseEmitter bulkTabling() {
|
||||||
AuthUtil.requireAdmin();
|
AuthUtil.requireAdmin();
|
||||||
SseEmitter emitter = new SseEmitter(600_000L);
|
SseEmitter emitter = new SseEmitter(10_800_000L); // 3h — 대량 백필 대응
|
||||||
|
|
||||||
executor.execute(() -> {
|
executor.execute(() -> {
|
||||||
try {
|
try {
|
||||||
@@ -309,7 +309,7 @@ public class RestaurantController {
|
|||||||
@PostMapping("/bulk-catchtable")
|
@PostMapping("/bulk-catchtable")
|
||||||
public SseEmitter bulkCatchtable() {
|
public SseEmitter bulkCatchtable() {
|
||||||
AuthUtil.requireAdmin();
|
AuthUtil.requireAdmin();
|
||||||
SseEmitter emitter = new SseEmitter(600_000L);
|
SseEmitter emitter = new SseEmitter(10_800_000L); // 3h — 대량 백필 대응
|
||||||
|
|
||||||
executor.execute(() -> {
|
executor.execute(() -> {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import java.net.http.HttpClient;
|
|||||||
import java.net.http.HttpRequest;
|
import java.net.http.HttpRequest;
|
||||||
import java.net.http.HttpResponse;
|
import java.net.http.HttpResponse;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import java.time.Duration;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
@@ -30,8 +31,10 @@ public class WebSearchService {
|
|||||||
private static final Logger log = LoggerFactory.getLogger(WebSearchService.class);
|
private static final Logger log = LoggerFactory.getLogger(WebSearchService.class);
|
||||||
private static final int MAX_RESULTS = 5;
|
private static final int MAX_RESULTS = 5;
|
||||||
|
|
||||||
|
private static final Duration REQ_TIMEOUT = Duration.ofSeconds(15);
|
||||||
private static final HttpClient HTTP = HttpClient.newBuilder()
|
private static final HttpClient HTTP = HttpClient.newBuilder()
|
||||||
.followRedirects(HttpClient.Redirect.NORMAL)
|
.followRedirects(HttpClient.Redirect.NORMAL)
|
||||||
|
.connectTimeout(Duration.ofSeconds(5))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
private static final Pattern DDG_RESULT = Pattern.compile(
|
private static final Pattern DDG_RESULT = Pattern.compile(
|
||||||
@@ -74,6 +77,7 @@ public class WebSearchService {
|
|||||||
String url = "https://openapi.naver.com/v1/search/webkr.json?query=" + encoded + "&display=30";
|
String url = "https://openapi.naver.com/v1/search/webkr.json?query=" + encoded + "&display=30";
|
||||||
HttpRequest req = HttpRequest.newBuilder()
|
HttpRequest req = HttpRequest.newBuilder()
|
||||||
.uri(URI.create(url))
|
.uri(URI.create(url))
|
||||||
|
.timeout(REQ_TIMEOUT)
|
||||||
.header("X-Naver-Client-Id", naverClientId)
|
.header("X-Naver-Client-Id", naverClientId)
|
||||||
.header("X-Naver-Client-Secret", naverClientSecret)
|
.header("X-Naver-Client-Secret", naverClientSecret)
|
||||||
.GET()
|
.GET()
|
||||||
@@ -104,6 +108,7 @@ public class WebSearchService {
|
|||||||
String url = "https://html.duckduckgo.com/html/?q=" + encoded;
|
String url = "https://html.duckduckgo.com/html/?q=" + encoded;
|
||||||
HttpRequest req = HttpRequest.newBuilder()
|
HttpRequest req = HttpRequest.newBuilder()
|
||||||
.uri(URI.create(url))
|
.uri(URI.create(url))
|
||||||
|
.timeout(REQ_TIMEOUT)
|
||||||
.header("User-Agent", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36")
|
.header("User-Agent", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36")
|
||||||
.header("Accept", "text/html,application/xhtml+xml")
|
.header("Accept", "text/html,application/xhtml+xml")
|
||||||
.header("Accept-Language", "ko-KR,ko;q=0.9")
|
.header("Accept-Language", "ko-KR,ko;q=0.9")
|
||||||
|
|||||||
Reference in New Issue
Block a user