Skip to content

Commit

Permalink
fix: Server is busy (langflow-ai#3878)
Browse files Browse the repository at this point in the history
  • Loading branch information
郑键 committed Sep 24, 2024
1 parent ed53fcd commit b34471b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Binary file added .dspy_cache/cache.db
Binary file not shown.
4 changes: 2 additions & 2 deletions src/backend/base/langflow/api/v1/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ async def build_vertices(
client_consumed_queue: asyncio.Queue,
event_manager: "EventManager",
) -> None:
build_task = asyncio.create_task(await asyncio.to_thread(_build_vertex, vertex_id, graph, event_manager))
build_task = asyncio.create_task(asyncio.to_thread(asyncio.run, _build_vertex(vertex_id, graph, event_manager)))
try:
await build_task
except asyncio.CancelledError as exc:
Expand Down Expand Up @@ -359,7 +359,7 @@ async def build_vertices(
async def event_generator(event_manager: EventManager, client_consumed_queue: asyncio.Queue) -> None:
if not data:
# using another thread since the DB query is I/O bound
vertices_task = asyncio.create_task(await asyncio.to_thread(build_graph_and_get_order))
vertices_task = asyncio.create_task(asyncio.to_thread(asyncio.run, build_graph_and_get_order()))
try:
await vertices_task
except asyncio.CancelledError:
Expand Down

0 comments on commit b34471b

Please sign in to comment.