Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix memory leak The `Tasker::Task` that pings each websocket was not being cleaned up and garbage-collected, which meant that the WebSocket itself was also not being GCed since it (and the WebSocketPinger itself) was referenced inside the task block, leading to a leak for every single WebSocket. I had a feeling this was the case because CPU and RAM consumption were not static after a lot of WebSockets had been connected, even if they were *no longer* connected. Turns out every single WebSocket was still being pinged or raising an exception if it were closed. That exception was not causing the `Tasker::Task` to stop. * Update src/cable/websocket_pinger.cr Co-authored-by: Jeremy Woertink <[email protected]>
- Loading branch information