Skip to content

Conversation

MiniCodeMonkey
Copy link
Member

Summary

This PR adds configurable timeout support for all Geocodio API operations, addressing timeout issues encountered in production environments where operations may take longer than the previously hard-coded 30-second timeout.

Changes

  • Added three configurable timeout parameters to GeocodioClient:
    • single_timeout: For single geocoding/reverse geocoding operations (default: 5 seconds)
    • batch_timeout: For batch geocoding operations (default: 30 minutes)
    • list_timeout: For List API operations (default: 60 seconds)
  • Added class constants for default timeout values to avoid magic numbers
  • Updated _request() method to accept an optional timeout parameter
  • Modified all API methods to pass the appropriate timeout based on operation type

Test Plan

  • Verified default timeout values are correctly applied when no custom values provided
  • Verified custom timeout values can be set via constructor parameters
  • Confirmed single geocoding operations use single_timeout
  • Confirmed batch operations use batch_timeout
  • Confirmed List API operations use list_timeout

Test Coverage

  • Unit tests in tests/unit/test_client.py
  • E2E tests in tests/e2e/test_lists_api.py (previously failing due to timeout, now passing)

- Add configurable timeouts for single, batch, and list API operations
- Default timeouts: 5s (single), 30min (batch), 60s (list API)
- Users can override defaults via GeocodioClient constructor
- Pass appropriate timeout from each method to _request()
@MiniCodeMonkey MiniCodeMonkey merged commit 3bf342e into main Aug 8, 2025
1 check passed
@MiniCodeMonkey MiniCodeMonkey deleted the feat/configurable-timeouts branch August 8, 2025 13:41
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.

1 participant