fix: remove lock from log transaction handling in Vertex (#5906)

This commit is contained in:
Gabriel Luiz Freitas Almeida 2025-01-24 08:26:47 -03:00 committed by GitHub
commit eff5eb6af2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -15,7 +15,7 @@ from loguru import logger
from langflow.exceptions.component import ComponentBuildError
from langflow.graph.schema import INPUT_COMPONENTS, OUTPUT_COMPONENTS, InterfaceComponentTypes, ResultData
from langflow.graph.utils import UnbuiltObject, UnbuiltResult
from langflow.graph.utils import UnbuiltObject, UnbuiltResult, log_transaction
from langflow.interface import initialize
from langflow.interface.listing import lazy_load_dict
from langflow.schema.artifact import ArtifactType
@ -632,17 +632,15 @@ class Vertex:
target: Optional target vertex
error: Optional error information
"""
# Commenting this out for now
# async with self._lock:
# if self.log_transaction_tasks:
# # Safely await and remove completed tasks
# task = self.log_transaction_tasks.pop()
# await task
if self.log_transaction_tasks:
# Safely await and remove completed tasks
task = self.log_transaction_tasks.pop()
await task
# # Create and track new task
# task = asyncio.create_task(log_transaction(flow_id, source, status, target, error))
# self.log_transaction_tasks.add(task)
# task.add_done_callback(self.log_transaction_tasks.discard)
# Create and track new task
task = asyncio.create_task(log_transaction(flow_id, source, status, target, error))
self.log_transaction_tasks.add(task)
task.add_done_callback(self.log_transaction_tasks.discard)
async def _get_result(
self,