A rate-limited HubSpot write is retried before succeeding 🟩

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Daniel Roth 2026-07-06 15:59:53 +00:00
parent 7e5dc1722e
commit 2ea9257036

View file

@ -5,6 +5,7 @@ from hubspot.client import Client # type: ignore[reportMissingTypeStubs]
from hubspot.crm.deals import SimplePublicObjectInput # type: ignore[reportMissingTypeStubs]
from infrastructure.hubspot.errors import HubspotRequestError
from infrastructure.hubspot.retry import call_with_retry
def _scrubbed(error: Exception) -> HubspotRequestError:
@ -51,11 +52,13 @@ class HubspotDealPropertiesClient:
self, deal_id: str, property_name: str, value: str
) -> None:
try:
self._client.crm.deals.basic_api.update( # type: ignore[reportUnknownMemberType]
deal_id,
simple_public_object_input=SimplePublicObjectInput(
properties={property_name: value}
),
call_with_retry(
lambda: self._client.crm.deals.basic_api.update( # type: ignore[reportUnknownMemberType]
deal_id,
simple_public_object_input=SimplePublicObjectInput(
properties={property_name: value}
),
)
)
except Exception as error:
# `from None` keeps the body-carrying SDK error out of tracebacks.