mirror of
https://github.com/j93es/browser-use-oauth.git
synced 2026-06-04 05:11:53 +09:00
[Fix] 에러 발생 시, 재시도 후 return 되지 않는 문제 해결
This commit is contained in:
parent
cb7dbccb04
commit
94ca383b82
2 changed files with 7 additions and 6 deletions
9
main.py
9
main.py
|
|
@ -151,17 +151,18 @@ async def scan_one_url(url: str, skip_html_check: bool = False):
|
|||
break
|
||||
|
||||
except Exception as e:
|
||||
if try_cnt >= 3:
|
||||
await clean_resources(agent, context, browser)
|
||||
|
||||
if try_cnt >= 1:
|
||||
print(f"❌ {url} 스캔에 실패했습니다. 에러: {e}")
|
||||
logger(f"❌ {url} 스캔에 실패했습니다. 에러: {e}")
|
||||
break
|
||||
return
|
||||
try_cnt += 1
|
||||
print(f"⚠️ 에러 발생: {e}. {try_cnt}번째 재시도 중...")
|
||||
|
||||
await clean_resources(agent, context, browser)
|
||||
|
||||
# 1분 대기
|
||||
await asyncio.sleep(60)
|
||||
await asyncio.sleep(5)
|
||||
# 반복문을 통해 재시도
|
||||
continue
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue