Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix http retries, increase retries #57

Merged
merged 2 commits into from
Aug 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/pds/registrysweepers/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
from typing import Mapping
from typing import Optional
from typing import Union
from urllib.error import HTTPError

import requests
from requests.exceptions import HTTPError
from retry import retry
from retry.api import retry_call

Expand Down Expand Up @@ -126,7 +126,7 @@ def query_registry_db(
requests.get,
fargs=[urllib.parse.urljoin(host.url, path)],
fkwargs={"auth": (host.username, host.password), "verify": host.verify, "json": req_content},
tries=4,
tries=6,
delay=2,
backoff=2,
logger=log,
Expand Down Expand Up @@ -171,7 +171,7 @@ def query_registry_db(
requests.delete,
fargs=[urllib.parse.urljoin(host.url, path)],
fkwargs={"auth": (host.username, host.password), "verify": host.verify},
tries=4,
tries=6,
delay=2,
backoff=2,
logger=log,
Expand Down Expand Up @@ -245,7 +245,7 @@ def write_updated_docs(host: Host, ids_and_updates: Mapping[str, Dict], index_na
_write_bulk_updates_chunk(host, index_name, bulk_updates_buffer)


@retry(exceptions=(HTTPError, RuntimeError), tries=4, delay=2, backoff=2, logger=log)
@retry(exceptions=(HTTPError, RuntimeError), tries=6, delay=2, backoff=2, logger=log)
def _write_bulk_updates_chunk(host: Host, index_name: str, bulk_updates: Iterable[str]):
headers = {"Content-Type": "application/x-ndjson"}
path = f"{index_name}/_bulk"
Expand Down
Loading