open-notebook/api/routers
Luis Novo f14020d385
fix: run execute_command_sync in thread pool to avoid event loop conflict (#468)
When async_processing=False, the sync path calls execute_command_sync()
which internally uses asyncio.run(). This fails when called from FastAPI's
already-running event loop with 'asyncio.run() cannot be called from a
running event loop'.

Wrapping the call in asyncio.to_thread() runs it in a thread pool executor,
avoiding the event loop conflict while preserving the synchronous behavior
from the API consumer's perspective.

Fixes #453
2026-01-24 18:19:02 -03:00
..
__init__.py Api podcast migration (#93) 2025-07-17 08:36:11 -03:00
auth.py Feat/localization tests docker (#371) 2026-01-15 13:51:05 -03:00
chat.py fix: improve error logging for chat model configuration issues (#458) 2026-01-23 16:45:13 -03:00
commands.py Feat/localization tests docker (#371) 2026-01-15 13:51:05 -03:00
config.py Feat/localization tests docker (#371) 2026-01-15 13:51:05 -03:00
context.py Feat/localization tests docker (#371) 2026-01-15 13:51:05 -03:00
embedding.py feat: content-type aware chunking and unified embedding (#444) 2026-01-21 23:49:08 -03:00
embedding_rebuild.py Feat/localization tests docker (#371) 2026-01-15 13:51:05 -03:00
episode_profiles.py Feat/localization tests docker (#371) 2026-01-15 13:51:05 -03:00
insights.py Feat/localization tests docker (#371) 2026-01-15 13:51:05 -03:00
models.py Feat/localization tests docker (#371) 2026-01-15 13:51:05 -03:00
notebooks.py feat: add ability to link existing sources to notebooks (OSS-311) (#177) 2025-10-19 17:52:14 -03:00
notes.py Feat/localization tests docker (#371) 2026-01-15 13:51:05 -03:00
podcasts.py Feat/localization tests docker (#371) 2026-01-15 13:51:05 -03:00
search.py refactor: reorganize folder structure for better maintainability 2026-01-03 14:04:27 -03:00
settings.py Feat/localization tests docker (#371) 2026-01-15 13:51:05 -03:00
source_chat.py Feat/localization tests docker (#371) 2026-01-15 13:51:05 -03:00
sources.py fix: run execute_command_sync in thread pool to avoid event loop conflict (#468) 2026-01-24 18:19:02 -03:00
speaker_profiles.py Feat/localization tests docker (#371) 2026-01-15 13:51:05 -03:00
transformations.py Feat/localization tests docker (#371) 2026-01-15 13:51:05 -03:00