| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
I don't think this is the way to go. BackgroundTasks only works on 2xx responses, but also, this kind of logic is more suited as a middleware. Where do we create the session_id? We should probably drop it in the same place.
Sorry, something went wrong.
|
The SseServerTransport class contains a memory leak due to improper cleanup of the _read_stream_writers collection. This issue needs to be addressed to prevent resource exhaustion during extended runtime. async def connect_sse(self, scope: Scope, receive: Receive, send: Send):
......
session_id = uuid4()
session_uri = f"{quote(self._endpoint)}?session_id={session_id.hex}"
self._read_stream_writers[session_id] = read_stream_writer
logger.debug(f"Created new session with ID: {session_id}")
.....
|
Sorry, something went wrong.
|
@Kludex I make a PR for this one also #582 to clean up the memory writer when sse disconnect . SSE Disconnect event handler is new feature I request on sysid/sse-starlette#127 |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Prevents memory leaks from stream writer