fix: 지역 재검색이 응답 없음이면 컨텍스트를 재생성해 1회 재시도
This commit is contained in:
1 parent
ac133efe4b
commit
a934b52ea6
1 file changed
+9
@@ -573,7 +573,16 @@ if (originalQuery) {
|
||||
return None
|
||||
query = f"{region} {title}"
|
||||
logger.info(f"[RETRY-REGION] 지역을 붙여 재검색: '{query}'")
|
||||
# 직전 검색 직후 바로 보내면 네이버가 list 응답을 주지 않는 경우가 있어 간격을 둔다
|
||||
await self.page.wait_for_timeout(self._retry_delay_ms)
|
||||
result = await self._try_search(address, title, jibun, query=query)
|
||||
if not result and not self._last_search_conclusive:
|
||||
# 응답 자체가 없으면 세션 단위 제한일 수 있다 → 컨텍스트를 새로 만들어 1회만 재시도
|
||||
logger.warning(f"[RETRY-REGION] 응답 없음 → 컨텍스트 재생성 후 재시도: '{query}'")
|
||||
await self.page.close()
|
||||
await self._recreate_context()
|
||||
await self.create_page()
|
||||
result = await self._try_search(address, title, jibun, query=query)
|
||||
if not result:
|
||||
# 응답 수신 여부로 '네이버가 응답을 안 줌'과 '응답은 왔으나 일치 업체 없음'을 구분한다
|
||||
state = "응답 수신, 일치 업체 없음" if self._last_search_conclusive else "응답 없음"
|
||||
|
||||
Reference in new issue
Block a user