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