redis / rueidis

A fast Golang Redis client that supports Client Side Caching, Auto Pipelining, Generics OM, RedisJSON, RedisBloom, RediSearch, etc.
Apache License 2.0
2.46k stars 158 forks source link

Send `DISCARD` automatically when a dedicated connection is recycled #579

Closed rueian closed 4 months ago

rueian commented 5 months ago

Following the discussion https://github.com/redis/rueidis/discussions/571, we had better send a DISCARD command when a dedicated connection is recycled by adding the command here: https://github.com/redis/rueidis/blob/5fe0175fe338cca5685968b73963e0eb159affb3/pipe.go#L751-L759

Doing this will prevent unintentional bugs and other accidents while improving developer experiences.