Replies: 1 comment
-
I am also curious about the necessity of using sub.Unsubscribe(). Specifically, I have a websocket endpoint and currently I unsubscribe when the websocket connection closes. But I'm wondering if the connection to Redis will automatically drop when the Go routine that handled the websocket request ends? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello! I was wondering if I should call
Unsubscribe()
before closing the connection to Redis or if it doesn't really matter since the connection is going to be closed anyway.Here's the relevant part of my code:
I noticed that go-redis automatically creates a secondary connection for keepalive pings so I had to close both
rc
andsub
, otherwise I would get errors that a closed connection was being used.Please let me know if there's something flawed in my code. Thanks!
Beta Was this translation helpful? Give feedback.
All reactions