fix: flush StreamedLogAsync tail when stop() cancels the task (#754)
## Summary In `StreamedLogAsync` (`src/apify_client/_streamed_log.py`), shutdown is driven by `stop()` cancelling the streaming task. `CancelledError` unwinds out of the `async for` before the trailing `_log_buffer_content(include_last_part=True)` runs, so whatever sits in the buffer (the tail after the last 8601 marker) is silently discarded. Wrapping the loop in `try/finally` guarantees the tail is flushed even on cancel. A regression test covers the bug.
V
Vlada Dusek committed
ea2333822937c4ad9b72fbba63e6fd7b52343055
Parent: 46b4789
Committed by GitHub <noreply@github.com>
on 5/26/2026, 6:53:57 AM