Skip to content

The agent engineering platform.

Flush (#30157)

William FHbac3a28e70b8
diff --git a/libs/core/langchain_core/tracers/langchain.py b/libs/core/langchain_core/tracers/langchain.py
index 7cdf5c92a3..8a14ce1fc6 100644
--- a/libs/core/langchain_core/tracers/langchain.py
+++ b/libs/core/langchain_core/tracers/langchain.py
@@ -50,8 +50,8 @@ def log_error_once(method: str, exception: Exception) -> None:
def wait_for_all_tracers() -> None:
"""Wait for all tracers to finish."""
- if rt._CLIENT is not None and rt._CLIENT.tracing_queue is not None:
- rt._CLIENT.tracing_queue.join()
+ if rt._CLIENT is not None:
+ rt._CLIENT.flush()
def get_client() -> Client:
@@ -319,5 +319,5 @@ class LangChainTracer(BaseTracer):
def wait_for_futures(self) -> None:
"""Wait for the given futures to complete."""
- if self.client is not None and self.client.tracing_queue is not None:
- self.client.tracing_queue.join()
+ if self.client is not None:
+ self.client.flush()