Spaces:
Runtime error
Runtime error
Update search_pipeline.py
Browse files- search_pipeline.py +3 -7
search_pipeline.py
CHANGED
|
@@ -168,11 +168,7 @@ async def scrape_target_url(client, result: dict):
|
|
| 168 |
url = result["href"]
|
| 169 |
|
| 170 |
try:
|
| 171 |
-
|
| 172 |
-
url,
|
| 173 |
-
timeout=12.0,
|
| 174 |
-
follow_redirects=True,
|
| 175 |
-
)
|
| 176 |
|
| 177 |
if response.status_code != 200:
|
| 178 |
logger.warning(
|
|
@@ -276,7 +272,7 @@ async def build_context_pipeline(
|
|
| 276 |
|
| 277 |
scraped = await asyncio.gather(
|
| 278 |
*tasks,
|
| 279 |
-
return_exceptions=
|
| 280 |
)
|
| 281 |
else:
|
| 282 |
async with httpx.AsyncClient(
|
|
@@ -290,7 +286,7 @@ async def build_context_pipeline(
|
|
| 290 |
|
| 291 |
scraped = await asyncio.gather(
|
| 292 |
*tasks,
|
| 293 |
-
return_exceptions=
|
| 294 |
)
|
| 295 |
|
| 296 |
blocks = []
|
|
|
|
| 168 |
url = result["href"]
|
| 169 |
|
| 170 |
try:
|
| 171 |
+
response = await client.get(url, timeout=12.0)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 172 |
|
| 173 |
if response.status_code != 200:
|
| 174 |
logger.warning(
|
|
|
|
| 272 |
|
| 273 |
scraped = await asyncio.gather(
|
| 274 |
*tasks,
|
| 275 |
+
return_exceptions=True,
|
| 276 |
)
|
| 277 |
else:
|
| 278 |
async with httpx.AsyncClient(
|
|
|
|
| 286 |
|
| 287 |
scraped = await asyncio.gather(
|
| 288 |
*tasks,
|
| 289 |
+
return_exceptions=True,
|
| 290 |
)
|
| 291 |
|
| 292 |
blocks = []
|