mirror of
https://github.com/allenai/olmocr.git
synced 2025-08-18 05:42:28 +00:00
Better catching of httpx errors and retrying them
This commit is contained in:
parent
d6a00135a7
commit
f8dcdf625a
@ -184,7 +184,7 @@ async def process_page(args, session: httpx.AsyncClient, worker_id: int, pdf_s3_
|
||||
output_tokens=base_response_data["usage"].get("completion_tokens", 0),
|
||||
is_fallback=False,
|
||||
)
|
||||
except (httpx.TimeoutException, httpx.ConnectError, asyncio.TimeoutError) as e:
|
||||
except (httpx.TransportError, asyncio.TimeoutError) as e:
|
||||
logger.warning(f"Client error on attempt {attempt} for {pdf_s3_path}-{page_num}: {e}")
|
||||
|
||||
# Now we want to do exponential backoff, and not count this as an actual page retry
|
||||
|
@ -2,7 +2,7 @@ _MAJOR = "0"
|
||||
_MINOR = "1"
|
||||
# On main and in a nightly release the patch should be one ahead of the last
|
||||
# released build.
|
||||
_PATCH = "41"
|
||||
_PATCH = "42"
|
||||
# This is mainly for nightly builds which have the suffix ".dev$DATE". See
|
||||
# https://semver.org/#is-v123-a-semantic-version for the semantics.
|
||||
_SUFFIX = ""
|
||||
|
Loading…
x
Reference in New Issue
Block a user