Skip to content

Commit

Permalink
add cleanup in unsubscribe
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielePalaia committed Aug 27, 2024
1 parent 619006f commit da75e53
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions rstream/consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,12 @@ async def unsubscribe(self, subscriber_name: str) -> None:
except BaseException as exc:
logger.warning("exception in unsubscribe of Consumer:" + str(exc))

stream = subscriber.stream

if stream in self._clients:
await self._clients[stream].remove_stream(stream)
await self._clients[stream].free_available_id(subscriber.subscription_id)

del self._subscribers[subscriber_name]

async def query_offset(self, stream: str, subscriber_name: str) -> int:
Expand Down

0 comments on commit da75e53

Please sign in to comment.