Skip to content

Commit

Permalink
Improved attachment handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Weves committed Feb 2, 2025
1 parent 68cb1f3 commit 569639e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions backend/onyx/connectors/airtable/airtable_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,8 @@ def _extract_field_values(
)
def get_attachment_with_retry(url: str) -> bytes | None:
attachment_response = requests.get(url)
if attachment_response.status_code == 200:
return attachment_response.content
return None
attachment_response.raise_for_status()
return attachment_response.content

attachment_content = get_attachment_with_retry(url)
if attachment_content:
Expand Down Expand Up @@ -339,7 +338,7 @@ def load_from_state(self) -> GenerateDocumentsOutput:
logger.info(f"Starting to process Airtable records for {table.name}.")

# Process records in parallel batches using ThreadPoolExecutor
PARALLEL_BATCH_SIZE = 16
PARALLEL_BATCH_SIZE = 8
max_workers = min(PARALLEL_BATCH_SIZE, len(records))

# Process records in batches
Expand Down

0 comments on commit 569639e

Please sign in to comment.