From 2ea92570362742f86a536012f59847786e035ddb Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Mon, 6 Jul 2026 15:59:53 +0000 Subject: [PATCH] =?UTF-8?q?A=20rate-limited=20HubSpot=20write=20is=20retri?= =?UTF-8?q?ed=20before=20succeeding=20=F0=9F=9F=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5 --- infrastructure/hubspot/deal_properties_client.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/infrastructure/hubspot/deal_properties_client.py b/infrastructure/hubspot/deal_properties_client.py index 1564b22de..3893c795b 100644 --- a/infrastructure/hubspot/deal_properties_client.py +++ b/infrastructure/hubspot/deal_properties_client.py @@ -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.