From 2f9bb08de582c41864151a00faf938a1e946f7eb Mon Sep 17 00:00:00 2001 From: Hassieb Pakzad <68423100+hassiebp@users.noreply.github.com> Date: Mon, 7 Jul 2025 17:36:51 +0200 Subject: [PATCH] fix(flushing): flush interval to millis in SpanProcessor --- langfuse/_client/environment_variables.py | 2 +- langfuse/_client/span_processor.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/langfuse/_client/environment_variables.py b/langfuse/_client/environment_variables.py index 7667ba213..b868b1e24 100644 --- a/langfuse/_client/environment_variables.py +++ b/langfuse/_client/environment_variables.py @@ -83,7 +83,7 @@ """ .. envvar:: LANGFUSE_FLUSH_INTERVAL -Max delay until a new ingestion batch is sent to the API. +Max delay in seconds until a new ingestion batch is sent to the API. **Default value:** ``1`` """ diff --git a/langfuse/_client/span_processor.py b/langfuse/_client/span_processor.py index 0e0a92f98..13451b6de 100644 --- a/langfuse/_client/span_processor.py +++ b/langfuse/_client/span_processor.py @@ -93,7 +93,9 @@ def __init__( span_exporter=langfuse_span_exporter, export_timeout_millis=timeout * 1_000 if timeout else None, max_export_batch_size=flush_at, - schedule_delay_millis=flush_interval, + schedule_delay_millis=flush_interval * 1_000 + if flush_interval is not None + else None, ) def on_end(self, span: ReadableSpan) -> None: