ref: Remove some useless asyncio.to_thread (#5149)

Remove some useless asyncio.to_thread
This commit is contained in:
Christophe Bornet 2024-12-08 20:13:08 +01:00 committed by GitHub
commit c0b25fa651
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 44 additions and 94 deletions

View file

@ -1,5 +1,3 @@
import asyncio
from langflow.processing.process import process_tweaks
from langflow.services.deps import get_session_service
@ -265,7 +263,7 @@ def test_tweak_not_in_template():
async def test_load_langchain_object_with_cached_session(basic_graph_data):
# Provide a non-existent session_id
session_service = await asyncio.to_thread(get_session_service)
session_service = get_session_service()
session_id1 = "non-existent-session-id"
graph1, artifacts1 = await session_service.load_session(session_id1, basic_graph_data)
# Use the new session_id to get the langchain_object again