Skip to content

Commit

Permalink
cancelling background task before publishing remaining items (#190)
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielePalaia authored May 2, 2024
1 parent 46f94e0 commit 03efdda
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rstream/producer.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,9 @@ async def close(self) -> None:

logger.debug("close(): Stopping background ingestion task and publish pending items")
if self.task is not None:
self.task.cancel()
for stream in self._buffered_messages:
await self._publish_buffered_messages(stream)
self.task.cancel()

self._close_called = True

Expand Down

0 comments on commit 03efdda

Please sign in to comment.