mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-12 13:29:04 +00:00
A rate-limited HubSpot write is retried before succeeding 🟩
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
7e5dc1722e
commit
2ea9257036
1 changed files with 8 additions and 5 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue