pierrejeambrun commented on code in PR #63180:
URL: https://github.com/apache/airflow/pull/63180#discussion_r2924352905


##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/log.py:
##########
@@ -59,6 +62,19 @@
 }
 
 
+def _batched_ndjson_stream(
+    raw_stream: Iterable[str],
+) -> Generator[str, None, None]:
+    buf: list[str] = []
+    for line in raw_stream:
+        buf.append(line)
+        if len(buf) >= _NDJSON_BATCH_SIZE:
+            yield "".join(buf)
+            buf.clear()

Review Comment:
   Yes, here I believe we could retrieve the timestamp of the latest log in the 
batch, compare it to current timestamp, and still yield the batch if the time 
window has passed. (even if batch is not full)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to