Skip to content

Commit

Permalink
fix: Flush zstd and correctly get buffer size
Browse files Browse the repository at this point in the history
  • Loading branch information
angus-langchain committed Dec 25, 2024
1 parent b418e38 commit 7a55526
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion python/langsmith/_internal/_background_thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ def _tracing_thread_drain_compressed_buffer(
) -> Optional[io.BytesIO]:
assert client.compressed_runs is not None
with client.compressed_runs.lock:
current_size = client.compressed_runs.buffer.tell()
client.compressed_runs.compressor_writer.flush()
current_size = client.compressed_runs.buffer.getbuffer().nbytes

if size_limit is not None and size_limit <= 0:
raise ValueError(f"size_limit must be positive; got {size_limit}")
Expand Down

0 comments on commit 7a55526

Please sign in to comment.