open-notebook/api
Troy Kelly 9ade6b4b04
Increase timeout for source creation API calls (#152)
Changed create_source() timeout from default 30s to 300s (5 minutes) to handle
long-running operations like PDF processing with OCR.

Issue:
- PDF imports were timing out after 30 seconds with "Failed to connect to API: timed out"
- PDF processing (especially with OCR/parsing) takes longer than the default timeout
- Users were unable to import PDF documents

Solution:
- Increased timeout to 300 seconds (5 minutes), matching the timeout used by ask_simple()
- This gives sufficient time for document processing operations to complete
- Prevents premature connection timeout errors

Technical Details:
- Modified api/client.py create_source() method
- Added timeout=300.0 parameter to _make_request() call
- Consistent with existing long-running operations (ask_simple uses same timeout)

Testing:
- Users should now be able to import PDFs without timeout errors
- Smaller PDFs will still complete quickly
- Larger PDFs have sufficient time to process
2025-10-18 12:55:17 -03:00
..
routers Version 1 (#160) 2025-10-18 12:46:22 -03:00
__init__.py Api podcast migration (#93) 2025-07-17 08:36:11 -03:00
auth.py Version 1 (#160) 2025-10-18 12:46:22 -03:00
chat_service.py Version 1 (#160) 2025-10-18 12:46:22 -03:00
client.py Increase timeout for source creation API calls (#152) 2025-10-18 12:55:17 -03:00
command_service.py Version 1 (#160) 2025-10-18 12:46:22 -03:00
context_service.py Version 1 (#160) 2025-10-18 12:46:22 -03:00
embedding_service.py Version 1 (#160) 2025-10-18 12:46:22 -03:00
episode_profiles_service.py Version 1 (#160) 2025-10-18 12:46:22 -03:00
insights_service.py Version 1 (#160) 2025-10-18 12:46:22 -03:00
main.py Version 1 (#160) 2025-10-18 12:46:22 -03:00
models.py Version 1 (#160) 2025-10-18 12:46:22 -03:00
models_service.py Version 1 (#160) 2025-10-18 12:46:22 -03:00
notebook_service.py Version 1 (#160) 2025-10-18 12:46:22 -03:00
notes_service.py Version 1 (#160) 2025-10-18 12:46:22 -03:00
podcast_api_service.py Version 1 (#160) 2025-10-18 12:46:22 -03:00
podcast_service.py Version 1 (#160) 2025-10-18 12:46:22 -03:00
search_service.py Version 1 (#160) 2025-10-18 12:46:22 -03:00
settings_service.py Version 1 (#160) 2025-10-18 12:46:22 -03:00
sources_service.py Version 1 (#160) 2025-10-18 12:46:22 -03:00
transformations_service.py Version 1 (#160) 2025-10-18 12:46:22 -03:00