Skip to content

Adding a retry logic for Hubspot objects loading#319

Merged
PascalCrow merged 3 commits intomasterfrom
retry_logic_objects
Apr 13, 2026
Merged

Adding a retry logic for Hubspot objects loading#319
PascalCrow merged 3 commits intomasterfrom
retry_logic_objects

Conversation

@PascalCrow
Copy link
Copy Markdown
Contributor

This PR is linked to that PR where a retry logic for connection errors was introduced for the loading of associations. This PR now introduces the same logic for the get request of objects to make the loading more stable.

@PascalCrow PascalCrow requested a review from lpillmann April 13, 2026 14:32
@PascalCrow PascalCrow self-assigned this Apr 13, 2026
@gemma-claude-assistant
Copy link
Copy Markdown
Contributor

PR #319 Review — HubSpot retry logic fix

This PR makes two targeted improvements to retry_request in ewah/hooks/hubspot.py:

  1. Bug fix: The original code had sleep(60) hardcoded, ignoring the wait_for_seconds parameter entirely. The new code correctly uses sleep(wait_for_seconds).
  2. New handling: ConnectionError exceptions are now caught and retried (with a re-raise on the final attempt), matching the intent of the existing retry loop.
  3. Default reduced: wait_for_seconds default halved from 60 → 30 seconds, consistent with the corrected sleep usage.
  4. Minor improvement: Sleep is now skipped on the last failed attempt (if try_number < retries), avoiding a pointless wait before giving up.

The logic is correct: a ConnectionError on the final attempt re-raises before reaching return request, so there's no risk of NameError on an unbound variable. Version bump to 0.9.27 is present as required.

Approved — no blocking issues.

@gemma-claude-assistant
Copy link
Copy Markdown
Contributor

Claude review cost: $0.1846 · 4 turns · 90s · eu.anthropic.claude-sonnet-4-6

@PascalCrow PascalCrow merged commit 005c30d into master Apr 13, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants